Skip to content

Commit

Permalink
chore: Simplify finish_kwargs to finish_args
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jan 4, 2024
1 parent 61e447a commit 7c5ffda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion process/management/commands/file_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def callback(client_state, channel, method, properties, input_message):
with delete_step(
ProcessingStep.Name.LOAD,
finish=finish,
finish_kwargs={"collection_id": collection_id, "collection_file_id": collection_file_id},
finish_args=(collection_id, collection_file_id),
collection_file_id=collection_file_id,
):
with transaction.atomic():
Expand Down
4 changes: 2 additions & 2 deletions process/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def create_step(name, collection_id, **kwargs):


@contextmanager
def delete_step(*args, finish=None, finish_kwargs={}, **kwargs):
def delete_step(*args, finish=None, finish_args=(), **kwargs):
try:
yield
# See the errback() function in the decorator() function. If a duplicate message is received, delete the step, so
Expand All @@ -139,7 +139,7 @@ def delete_step(*args, finish=None, finish_kwargs={}, **kwargs):
_delete_step(*args, **kwargs)
finally:
if finish:
finish(**finish_kwargs)
finish(*finish_args)


def _delete_step(step_type, **kwargs):
Expand Down

0 comments on commit 7c5ffda

Please sign in to comment.