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

Clean exit on Ctrl+C #14

Merged
merged 9 commits into from
Sep 24, 2024
Merged

Clean exit on Ctrl+C #14

merged 9 commits into from
Sep 24, 2024

Conversation

harshil21
Copy link
Member

@harshil21 harshil21 commented Sep 19, 2024

Ignores SIGINT in the child processes, so Ctrl+C events are cleanly handled within them, making the KeyboardInterrupt handling in main.py actually stop() the child processes properly.

To be merged after testing on the PI.

@harshil21 harshil21 added bug Something isn't working enhancement New feature or request labels Sep 19, 2024
tests/test_airbrakes.py Outdated Show resolved Hide resolved
main.py Show resolved Hide resolved
Copy link
Member

@JacksonElia JacksonElia left a comment

Choose a reason for hiding this comment

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

As I was kinda saying earlier today, I think while this is the "correct" way to do this, it adds too much bloat to the code (plus looks foreign af to new programmers), so I would prefer we put a little more effort into the testing scripts rather than add this to our main code.

@harshil21 harshil21 changed the title Use context managers for clean exit on Ctrl+C Clean exit on Ctrl+C Sep 20, 2024
@harshil21
Copy link
Member Author

alright, reverts the context manager change for the sake of understanding code at first glance. I manually ran scripts/run_main_local.py and it works great.

Apparently this didn't work on the PI today, but I didn't get to much to time to see why, so hold off on merging for now.

@harshil21 harshil21 marked this pull request as draft September 20, 2024 07:26
Copy link
Member

@JacksonElia JacksonElia left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple small things

main.py Show resolved Hide resolved
scripts/run_main_local.py Outdated Show resolved Hide resolved
@harshil21 harshil21 mentioned this pull request Sep 22, 2024
@harshil21 harshil21 marked this pull request as ready for review September 22, 2024 07:30
@harshil21 harshil21 marked this pull request as draft September 22, 2024 07:30
@harshil21 harshil21 marked this pull request as ready for review September 24, 2024 23:03
@harshil21
Copy link
Member Author

Confirmed working on the PI.

@harshil21 harshil21 merged commit 737df1a into main Sep 24, 2024
2 checks passed
@harshil21 harshil21 deleted the fix-ctrl-c branch September 24, 2024 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants