mute crash notifications when service is just started (#1245)

* mute crash notifications when service is just started

* mute first service crash if within 15s of start
This commit is contained in:
Aiden McClelland
2022-02-21 16:53:06 -07:00
committed by GitHub
parent 272704794c
commit 42e1a02a61
2 changed files with 31 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ use std::sync::Arc;
use std::time::Duration;
use bollard::Docker;
use chrono::Utc;
use color_eyre::eyre::eyre;
use patch_db::json_ptr::JsonPointer;
use patch_db::{DbHandle, LockType, PatchDb, Revision};
@@ -287,13 +288,14 @@ impl RpcContext {
main,
MainStatus::Stopped, /* placeholder */
) {
MainStatus::BackingUp { started, health } => {
if let Some(started) = started {
MainStatus::Running { started, health }
MainStatus::BackingUp { started, .. } => {
if let Some(_) = started {
MainStatus::Starting
} else {
MainStatus::Stopped
}
}
MainStatus::Running { .. } => MainStatus::Starting,
a => a,
};
*main = new_main;