Skip to content

Commit

Permalink
Merge pull request #217 from uw-it-aca/feature/daemon-error-exit
Browse files Browse the repository at this point in the history
end daemon pod on exception, let restartPolicy restart pod
  • Loading branch information
mikeseibel authored Oct 21, 2024
2 parents 1cbbf53 + 8e9a70f commit dac2e20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/call_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def run(self):
rv = int(str(ex))
except Exception as ex:
rv = -1
logger.error("exception: {}".format(ex), exc_info=True)
logger.error("{} exception: {}".format(
"daemon" if self.is_daemon else "cron", ex),
exc_info=True)

finish = time.time()
duration = finish - start
Expand All @@ -124,6 +126,10 @@ def run(self):
exit=(rv if rv and isinstance(rv, int) else 0))

if self.is_daemon:
if rv < 0:
self.metrics.flush()
break

self.pause(start)
else:
self.metrics.flush()
Expand Down

0 comments on commit dac2e20

Please sign in to comment.