Order of script events #1933
Replies: 1 comment
-
|
Looking at the code, seems that scripts are simply forked/exec'd without waiting for process completion. This explains the behaviour I'm seeing both in terms of order of execution and that multiple event scripts may be running at the same time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm after a bit of clarification regarding the order in which the on_XXX scripts are invoked during a period of motion. My expectation is that the flow would be:
on_event_start
on_motion_detected (or does this come before event_start?)
on_movie_start
on_picture_save
on_picture_save
... x N
on_movie_end
on_event_end
The log seems to bear this out:
However adding a bit of logging to the scripts I'm invoking seem to show something different:
In particular, xml_create is invoked from on_event_start, yet appears to occur some 4 seconds after the video/images are being written.
Secondary question, does motion wait for each script to complete processing before continuing (synchronous) or are they fire and forget (async)? My scripts are essentially putting together an XML file and I'm getting instances where the file either has things missing or is corrupted in some way which suggests the latter.
This is with motion 4.5.1
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions