Skip to content

Commit

Permalink
Merge pull request #199 from VukManojlovic/hotfix-watchdog
Browse files Browse the repository at this point in the history
Hotfix: Set up try catch to avoid worker failure
  • Loading branch information
dule1322 authored May 29, 2024
2 parents 17c6377 + db2f572 commit 2081c88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coretex/_task/worker/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def track(taskRun: TaskRun) -> Iterator[FileEventHandler]:

eventHandler = FileEventHandler()
observer.schedule(eventHandler, root, recursive = True) # type: ignore[no-untyped-call]
observer.start() # type: ignore[no-untyped-call]
try:
observer.start() # type: ignore[no-untyped-call]
except OSError as e:
logging.getLogger("coretexpylib").error(f"Failed to start watchdog observer with error: {e}")

yield eventHandler
finally:
observer.stop() # type: ignore[no-untyped-call]
Expand Down

0 comments on commit 2081c88

Please sign in to comment.