mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
fix: [sync client] don't launch client if ail server not linked with a sync queue
This commit is contained in:
parent
23ad74c591
commit
0a9caf75c9
1 changed files with 5 additions and 2 deletions
|
@ -267,7 +267,7 @@ def refresh_ail_instance_connection(ail_uuid):
|
||||||
client_id = clients_id[0]
|
client_id = clients_id[0]
|
||||||
else:
|
else:
|
||||||
client_id = None
|
client_id = None
|
||||||
launch_required = is_ail_instance_push_enabled(ail_uuid)
|
launch_required = is_ail_instance_push_enabled(ail_uuid) and is_ail_instance_linked_to_sync_queue(ail_uuid)
|
||||||
|
|
||||||
# relaunch
|
# relaunch
|
||||||
if client_id and launch_required:
|
if client_id and launch_required:
|
||||||
|
@ -312,7 +312,7 @@ class AIL2AILClientManager(object):
|
||||||
def get_all_sync_clients_to_launch(self):
|
def get_all_sync_clients_to_launch(self):
|
||||||
ail_instances_to_launch = []
|
ail_instances_to_launch = []
|
||||||
for ail_uuid in get_all_ail_instance():
|
for ail_uuid in get_all_ail_instance():
|
||||||
if is_ail_instance_push_enabled(ail_uuid):
|
if is_ail_instance_push_enabled(ail_uuid) and is_ail_instance_linked_to_sync_queue(ail_uuid):
|
||||||
ail_instances_to_launch.append(ail_uuid)
|
ail_instances_to_launch.append(ail_uuid)
|
||||||
return ail_instances_to_launch
|
return ail_instances_to_launch
|
||||||
|
|
||||||
|
@ -466,6 +466,9 @@ def is_ail_instance_sync_enabled(ail_uuid, sync_mode=None):
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def is_ail_instance_linked_to_sync_queue(ail_uuid):
|
||||||
|
return r_serv_sync.exists(f'ail:instance:sync_queue:{ail_uuid}')
|
||||||
|
|
||||||
def change_pull_push_state(ail_uuid, pull=None, push=None):
|
def change_pull_push_state(ail_uuid, pull=None, push=None):
|
||||||
edited = False
|
edited = False
|
||||||
curr_pull = is_ail_instance_pull_enabled(ail_uuid)
|
curr_pull = is_ail_instance_pull_enabled(ail_uuid)
|
||||||
|
|
Loading…
Reference in a new issue