fix: [urlextract importer] fix parent map + replace set JSON queue by list

This commit is contained in:
Terrtia 2020-05-06 16:57:13 +02:00
parent bae2fd79df
commit 8c864fdba0
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 5 additions and 8 deletions

View file

@ -46,10 +46,10 @@ def get_json_importer_list():
def add_json_to_json_queue(json_item):
json_item = json.dumps(json_item)
r_serv_db.sadd('importer:json:item', json_item)
r_serv_db.rpush('importer:json:item', json_item)
def get_json_item_to_import():
return r_serv_db.spop('importer:json:item')
return r_serv_db.lpop('importer:json:item')
def get_json_receiver_class(feeder_name_in):
global importer_list

View file

@ -32,9 +32,6 @@ def add_item_parent_by_parent_id(parent_type, parent_id, item_id):
add_item_parent(parent_item_id, item_id)
def add_item_parent(parent_item_id, item_id):
if not exist_item(parent_item_id):
return False
else:
r_serv_metadata.hset('paste_metadata:{}'.format(item_id), 'father', parent_item_id)
r_serv_metadata.sadd('paste_children:{}'.format(parent_item_id), item_id)
return True