From fc284cee577ebf3a221eacec3e88bac15aec6ed9 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 2 May 2019 18:40:42 +0200 Subject: [PATCH] feat(client): naive watchdog update --- client.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client.py b/client.py index c77972d..54d484a 100644 --- a/client.py +++ b/client.py @@ -85,7 +85,7 @@ class RCFClient(object): # Database and connexion agent self.watchdog_agent = threading.Thread( - target=watchdog_worker, args=(self.serial_feed, .5, self.stop_event), name="watchdog-agent") + target=watchdog_worker, args=(self.serial_feed, 2, self.stop_event), name="watchdog-agent") self.watchdog_agent.daemon = True self.watchdog_agent.start() @@ -502,12 +502,15 @@ def watchdog_worker(feed,interval, stop_event): for datatype in helpers.SUPPORTED_TYPES: for item in getattr(bpy.data, helpers.CORRESPONDANCE[datatype]): + key = "{}/{}".format(datatype, item.name) + if item.id == 'None': item.id = bpy.context.scene.session_settings.username - key = "{}/{}".format(datatype, item.name) feed.put(('DUMP',key,None)) elif item.is_dirty: - logger.info("{} needs update".format(item.name)) + logger.info("{} needs update".format(item.name)) + feed.put(('DUMP',key,None)) + item.is_dirty = False time.sleep(interval) logger.info("watchdog thread stopped")