forked from platypush/platypush
Better events orchestration on camera.pi backend
This commit is contained in:
parent
bb43facee5
commit
85512424ae
1 changed files with 6 additions and 3 deletions
|
@ -72,6 +72,7 @@ class CameraPiBackend(Backend):
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
if not self.start_recording_event.is_set():
|
||||||
self.start_recording_event.wait()
|
self.start_recording_event.wait()
|
||||||
self.logger.info('Starting camera recording')
|
self.logger.info('Starting camera recording')
|
||||||
|
|
||||||
|
@ -82,9 +83,11 @@ class CameraPiBackend(Backend):
|
||||||
self.stop_recording_event.wait()
|
self.stop_recording_event.wait()
|
||||||
self.logger.info('Stopping camera recording')
|
self.logger.info('Stopping camera recording')
|
||||||
except ConnectionError as e:
|
except ConnectionError as e:
|
||||||
pass
|
self.logger.info('Client {} closed connection'.format(connection))
|
||||||
finally:
|
finally:
|
||||||
connection.close()
|
try: connection.close()
|
||||||
|
except: pass
|
||||||
|
|
||||||
self.camera.stop_recording()
|
self.camera.stop_recording()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue