moved callback registration to AFTER our instance updates ETCD

master
B.J. Dweck 2021-02-07 14:02:53 +02:00
parent 0a93abe30f
commit 70eb98da76
1 changed files with 3 additions and 3 deletions

View File

@ -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)