Skip to content

Commit

Permalink
Add more logging to workers
Browse files Browse the repository at this point in the history
  • Loading branch information
iharsuvorau committed Jan 31, 2024
1 parent b079e5b commit 777cc0a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ async def process(self, processing_request: ProcessingRequest):
# remove downloaded files
for file in files_to_delete:
if file.path.exists():
logger.info(f"Deleting file: {file.path}")
file.path.unlink()
# remove results
for dir in dirs_to_delete:
logger.info(f"Deleting directory: {dir}")
shutil.rmtree(dir, ignore_errors=True)

# set token to None to force re-authentication, because the token might have expired
Expand Down
2 changes: 2 additions & 0 deletions backend/workers/kronos/kronos/kronos_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ async def process(self, processing_request: ProcessingRequest):
finally:
for file in files_to_delete:
if file.path.exists():
logger.info(f"Deleting file: file_id={file.id}, path={file.path}")
file.path.unlink()
for dir in dirs_to_delete:
logger.info(f"Deleting directory: path={dir}")
shutil.rmtree(dir, ignore_errors=True)

# set token to None to force re-authentication, because the token might have expired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ async def process(self, processing_request: ProcessingRequest):
finally:
for file in files_to_delete:
if file.path.exists():
logger.info(f"Deleting file: {file.path}")
file.path.unlink()

# set token to None to force re-authentication, because the token might have expired
Expand Down

0 comments on commit 777cc0a

Please sign in to comment.