diff --git a/syncthing_monitor/__main__.py b/syncthing_monitor/__main__.py index 74ac122..1bf2688 100644 --- a/syncthing_monitor/__main__.py +++ b/syncthing_monitor/__main__.py @@ -62,14 +62,14 @@ class SyncthingMonitor: self.syncthing.disable_announce_discovery_and_relay() self.syncthing.sync_config() - print("Registering etcd update callback...", flush=True) - self.etcd.register_device_update_handler(self.update_devices) - print("Attempting to add this device to etcd...", flush=True) self.etcd.add_device_to_cluster(self.my_device_id, self.syncthing_node_name, self.syncthing_publish_address) print("Added this device to cluster with publish address: {0}".format(self.syncthing_publish_address), flush=True) + print("Registering etcd update callback...", flush=True) + self.etcd.register_device_update_handler(self.update_devices) + self.update_devices(None) print("Entering loop...", flush=True)