Skip to content

Commit

Permalink
Returning exit code from workers
Browse files Browse the repository at this point in the history
  • Loading branch information
gemblerz committed Jan 22, 2025
1 parent 6da036b commit 33a4f2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ def main(args):
workers.append(worker)
worker.start()


# If one of the workers fails, the main process should return the exit code of the failed worker.
# Hopefully, the error messages are shown in the main process's stdout.
exit_code = 0
for worker in workers:
worker.join()
return 0
if worker.exitcode != 0:
exit_code = worker.exitcode
return exit_code


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion sage.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "imagesampler"
description: "Periodical/Trigger-based Image sampler"
version : "0.3.7"
version : "0.3.8"
namespace: "waggle"
authors: "Yongho Kim <[email protected]>"
collaborators: "Waggle Team <https://wa8.gl>"
Expand Down

0 comments on commit 33a4f2a

Please sign in to comment.