Commit cb2154bf authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed bad upload proc join code, again. This time with test.

parent c6e4ce75
Pipeline #52518 passed with stages
in 17 minutes and 46 seconds
......@@ -808,9 +808,9 @@ class Upload(Proc):
# check the join condition, i.e. all calcs have been processed
if not self.process_running and processed_calcs >= total_calcs:
# this can easily be called multiple times, e.g. upload finished after all calcs finished
modified_upload = self._get_collection().update(
dict(_id=self.upload_id, joined__ne=True),
{'$set': {'joined': True}}, upsert=False)
modified_upload = self._get_collection().find_one_and_update(
{'_id': self.upload_id, 'joined': {'$ne': True}},
{'$set': {'joined': True}})
if modified_upload is not None:
......@@ -71,6 +71,7 @@ def assert_processing(upload: Upload, published: bool = False):
assert upload.upload_id is not None
assert len(upload.errors) == 0
assert upload.tasks_status == SUCCESS
assert upload.joined
upload_files = UploadFiles.get(upload.upload_id, is_authorized=lambda: True)
if published:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment