Skip to content

Commit

Permalink
Handle unknown status code exit as a reason for restart
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Dec 18, 2024
1 parent 5b05398 commit 89505bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ impl Cli {
}
AppStatusCode::Unknown(status_code) => {
error!(%status_code, "Application exited with unexpected status code");

if last_start.elapsed() >= MIN_RUNTIME_DURATION_FOR_AUTORESTART {
self.after_crash = true;
continue;
}

process::exit(status_code);
}
},
Expand Down

0 comments on commit 89505bd

Please sign in to comment.