chg: [sync module] debug

This commit is contained in:
Terrtia 2022-05-17 14:35:28 +02:00
parent 188747417f
commit 0635bfedb6
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -48,8 +48,6 @@ class Sync_module(AbstractModule):
def compute(self, message): def compute(self, message):
print(message)
### REFRESH DICT ### REFRESH DICT
if self.last_refresh < ail_2_ail.get_last_updated_sync_config(): if self.last_refresh < ail_2_ail.get_last_updated_sync_config():
self.last_refresh = time.time() self.last_refresh = time.time()
@ -73,15 +71,14 @@ class Sync_module(AbstractModule):
# check filter + tags # check filter + tags
for queue_uuid in self.dict_sync_queues: for queue_uuid in self.dict_sync_queues:
filter_tags = self.dict_sync_queues[queue_uuid]['filter'] filter_tags = self.dict_sync_queues[queue_uuid]['filter']
print(tags)
print(filter_tags)
print(tags.issubset(filter_tags))
if filter_tags and tags: if filter_tags and tags:
#print(message)
#print(f'tags: {tags} filter: {filter_tags}')
if tags.issubset(filter_tags): if tags.issubset(filter_tags):
obj_dict = obj.get_default_meta() obj_dict = obj.get_default_meta()
# send to queue push and/or pull # send to queue push and/or pull
for dict_ail in self.dict_sync_queues[queue_uuid]['ail_instances']: for dict_ail in self.dict_sync_queues[queue_uuid]['ail_instances']:
print(f'{dict_ail['ail_uuid']} {message}')
ail_2_ail.add_object_to_sync_queue(queue_uuid, dict_ail['ail_uuid'], obj_dict, ail_2_ail.add_object_to_sync_queue(queue_uuid, dict_ail['ail_uuid'], obj_dict,
push=dict_ail['push'], pull=dict_ail['pull']) push=dict_ail['push'], pull=dict_ail['pull'])