Merge branch 'master' of github.com:ckan/ckanext-harvest

This commit is contained in:
amercader 2020-10-08 12:16:05 +02:00
commit 7ad2bd5f38
2 changed files with 12 additions and 3 deletions

View File

@ -12,8 +12,6 @@ Unreleased_
*********** ***********
*********** ***********
1.3.2_ - 2020-10-08 1.3.2_ - 2020-10-08
*********** ***********
@ -23,6 +21,11 @@ Changed
- Calculate timeouts based on last finished object instead of job creation time #418 - Calculate timeouts based on last finished object instead of job creation time #418
Fixed
-----
- Fix resubmitting harvest objects to Redis fetch queue #421
*********** ***********
1.3.1_ - 2020-09-01 1.3.1_ - 2020-09-01

View File

@ -167,8 +167,14 @@ def resubmit_objects():
.filter_by(state='WAITING') \ .filter_by(state='WAITING') \
.all() .all()
objects_in_queue = []
fetch_routing_key = get_fetch_routing_key()
objects_in_queue = [json.loads(o)['harvest_object_id']
for o in redis.lrange(fetch_routing_key, 0, -1)]
for object_id, in waiting_objects: for object_id, in waiting_objects:
if not redis.get(object_id): if object_id not in objects_in_queue:
log.debug('Re-sent object {} to the fetch queue'.format(object_id)) log.debug('Re-sent object {} to the fetch queue'.format(object_id))
publisher.send({'harvest_object_id': object_id}) publisher.send({'harvest_object_id': object_id})