Do not crash range tasks if celery result backend does not support saving the group's state
This commit is contained in:
parent
a1ec4437e6
commit
e31b61bee1
3 changed files with 13 additions and 4 deletions
|
@ -29,7 +29,7 @@ def incremental_bitbucket_lister(self, **lister_args):
|
|||
@app.task(name='swh.lister.bitbucket.tasks.RangeBitBucketLister',
|
||||
bind=True)
|
||||
def range_bitbucket_lister(self, start, end, **lister_args):
|
||||
self.log.debug('%s(start=%s, end=%d), lister_args=%s' % (
|
||||
self.log.debug('%s(start=%s, end=%s), lister_args=%s' % (
|
||||
self.name, start, end, lister_args))
|
||||
lister = new_lister(**lister_args)
|
||||
lister.run(min_bound=start, max_bound=end)
|
||||
|
@ -47,7 +47,10 @@ def full_bitbucket_relister(self, split=None, **lister_args):
|
|||
promise = group(range_bitbucket_lister.s(minv, maxv, **lister_args)
|
||||
for minv, maxv in ranges)()
|
||||
self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
|
||||
promise.save() # so that we can restore the GroupResult in tests
|
||||
try:
|
||||
promise.save() # so that we can restore the GroupResult in tests
|
||||
except NotImplementedError:
|
||||
self.log.info('Unable to call save_group with current result backend.')
|
||||
return promise.id
|
||||
|
||||
|
||||
|
|
|
@ -48,7 +48,10 @@ def full_github_relister(self, split=None, **lister_args):
|
|||
promise = group(range_github_lister.s(minv, maxv, **lister_args)
|
||||
for minv, maxv in ranges)()
|
||||
self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
|
||||
promise.save() # so that we can restore the GroupResult in tests
|
||||
try:
|
||||
promise.save() # so that we can restore the GroupResult in tests
|
||||
except NotImplementedError:
|
||||
self.log.info('Unable to call save_group with current result backend.')
|
||||
return promise.id
|
||||
|
||||
|
||||
|
|
|
@ -57,7 +57,10 @@ def full_gitlab_relister(self, **lister_args):
|
|||
promise = group(range_gitlab_lister.s(minv, maxv, **lister_args)
|
||||
for minv, maxv in ranges)()
|
||||
self.log.debug('%s OK (spawned %s subtasks)' % (self.name, len(ranges)))
|
||||
promise.save()
|
||||
try:
|
||||
promise.save()
|
||||
except NotImplementedError:
|
||||
self.log.info('Unable to call save_group with current result backend.')
|
||||
return promise.id
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue