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

fix: make graceful daemon shutdown exit with code 0 #504

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Fix reading of configuration files that lacks a `shared` section.

- Made the daemon exit gracefully (exit code 0) on SIGINT and SIGTEM.

## [3.3.3] - 2024-01-04

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pueue/src/daemon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn setup_signal_panic_handling(settings: &Settings, sender: &TaskSender) -> Resu
ctrlc::set_handler(move || {
// Notify the task handler
sender_clone
.send(Shutdown::Emergency)
.send(Shutdown::Graceful)
.expect("Failed to send Message to TaskHandler on Shutdown");
})?;

Expand Down
2 changes: 1 addition & 1 deletion pueue/tests/daemon/integration/shutdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async fn test_ctrlc() -> Result<()> {
let result = child.try_wait();
assert!(matches!(result, Ok(Some(_))));
let code = result.unwrap().unwrap();
assert!(matches!(code.code(), Some(1)));
assert!(matches!(code.code(), Some(0)));

Ok(())
}
Expand Down
Loading