Skip to content

Commit

Permalink
fix uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
gireg.roussel committed Dec 24, 2024
1 parent 4248aa1 commit 64d910c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ def __init__(

def save_item_metadata(self, fct):
@functools.wraps(fct)
async def wrapper(item: Item, active_config_name: str, *args):
async def wrapper(item: Item, *args):
item.state = args[0].value
await fct(item)
active_config_name = args[1]
self.metadata_storage.save_item_metadata(item, active_config_name)

return wrapper
Expand All @@ -50,7 +51,7 @@ async def set_error_state(item: Item, error_message: str):
logger.info(f"Starting {uploader_state.value}")
try:
logger.info(f"Entering try {uploader_state.value}")
await task_fct(item, uploader_state)
await task_fct(item, uploader_state, active_config_name)
except Exception as e:
logger.error(f"Error during {uploader_state.value}: {e}")
await set_error_state(item, str(e))
Expand Down

0 comments on commit 64d910c

Please sign in to comment.