try catch

This commit is contained in:
2025-08-12 23:06:50 +02:00
parent c865a18ccb
commit 8c56de9e82
+6 -1
View File
@@ -180,7 +180,12 @@ if __name__ == '__main__':
def processing_thread():
while True:
import processing
processing.do_job(environments, lambda: socketio.emit('environments', get_envs_to_emit(), namespace='/ws/environment'))
def emit_envs():
try:
socketio.emit('environments', get_envs_to_emit(), namespace='/ws/environment')
except Exception as e:
logger.error(f"Error emitting environments: {str(e)}")
processing.do_job(environments, lambda: emit_envs())
environment_update_event.wait(timeout=1000)
environment_update_event.clear()