]> www.vanbest.org Git - motioneye-debian/commitdiff
added motion_restart_on_errors setting to control if motion is restarted upon errors...
authorCalin Crisan <ccrisan@gmail.com>
Thu, 24 Nov 2016 13:06:59 +0000 (15:06 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Thu, 24 Nov 2016 13:06:59 +0000 (15:06 +0200)
extra/motioneye.conf.sample
motioneye/mjpgclient.py
motioneye/settings.py

index 43a860fca267bd21676f6c38c50b84cc653b0bc0..3271e26fa48b38e6f3bb2fd92674757df78260e4 100644 (file)
@@ -42,6 +42,9 @@ mount_check_interval 300
 # interval in seconds at which motionEye checks if motion is running
 motion_check_interval 10
 
+# whether to restart the motion daemon when an error occurs while communicating with it
+motion_restart_on_errors false
+
 # interval in seconds at which the janitor is called
 # to remove old pictures and movies
 cleanup_interval 43200
index 7e4231f091e3288321e0ceb9a6ebfe33ab33ce2e..1c3199e90ca6e87549de662f7f1e8123dfb5e8d5 100644 (file)
@@ -72,9 +72,10 @@ class MjpgClient(IOStream):
                 logging.error('connection problem detected for mjpg client for camera %(camera_id)s on port %(port)s' % {
                         'port': self._port, 'camera_id': self._camera_id})
  
-                motionctl.stop(invalidate=True) # this will close all the mjpg clients
-                motionctl.start(deferred=True)
+                if settings.MOTION_RESTART_ON_ERRORS:
+                    motionctl.stop(invalidate=True) # this will close all the mjpg clients
+                    motionctl.start(deferred=True)
+
             MjpgClient._last_erroneous_close_time = now
         
     def _check_error(self):
@@ -293,8 +294,9 @@ def _garbage_collector():
             logging.error('mjpg client timed out receiving data for camera %(camera_id)s on port %(port)s' % {
                     'camera_id': camera_id, 'port': port})
             
-            motionctl.stop(invalidate=True) # this will close all the mjpg clients
-            motionctl.start(deferred=True)
+            if settings.MOTION_RESTART_ON_ERRORS:
+                motionctl.stop(invalidate=True) # this will close all the mjpg clients
+                motionctl.start(deferred=True)
             
             break
 
index ff442c4be51c08d96eab7bb77ed2c72f1b663756..6265064568d56882e369929f1153e8344bf5e75d 100644 (file)
@@ -71,6 +71,9 @@ MOUNT_CHECK_INTERVAL = 300
 # interval in seconds at which motionEye checks if motion is running
 MOTION_CHECK_INTERVAL = 10
 
+# whether to restart the motion daemon when an error occurs while communicating with it
+MOTION_RESTART_ON_ERRORS = False
+
 # interval in seconds at which the janitor is called
 # to remove old pictures and movies
 CLEANUP_INTERVAL = 43200