mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [urlextract importer] fix parent map + replace set JSON queue by list
This commit is contained in:
parent
bae2fd79df
commit
8c864fdba0
2 changed files with 5 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -32,12 +32,9 @@ 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
|
||||
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
|
||||
|
||||
def add_map_obj_id_item_id(obj_id, item_id, obj_type):
|
||||
if obj_type == 'twitter_id':
|
||||
|
|
Loading…
Reference in a new issue