Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard stop worker by sending ctrl-c twice #86

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

mgax
Copy link
Contributor

@mgax mgax commented Jul 19, 2024

Fixes #84.

Comment on lines +104 to +106
if self.running:
# Wait before checking for another task
time.sleep(self.interval)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ctrl-c has just interrupted a task, we should not sleep, but rather exit immediately.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense to me - nice catch! Could that be immortalised as a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you might ask that :) I've added the comment.

Copy link
Owner

@RealOrangeOne RealOrangeOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit for a comment, but otherwise this looks great.

@RealOrangeOne RealOrangeOne merged commit 39ceb97 into RealOrangeOne:master Jul 23, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it easy to stop the database worker by sending it SIGQUIT or repeated SIGINT
2 participants