add error status (#2746)

* add error status

* update types

* ṗ̶̰̙̓͒̈́ͅü̵̢̙̫̣ŗ̷̪̺̺͛g̴̲͉͎̬̒̇e̵̪̎̅͌ ̶̡̜̘͐͛t̶͎͍̣̿̍̐h̴͕̩͗̈́̎̑e̵͚͒̂͝ ̸̛͙̦͈͝v̶̱͙̬̽̔ọ̶̧̡̒̓i̸̬̲͍̋̈́d̴͉̀

* fix some extra voids

* add `package.rebuild`

* introduce error status and pkg rebuild and fix mocks

* minor fixes

* fix build

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
Aiden McClelland
2024-09-26 20:19:06 -06:00
committed by GitHub
parent db0695126f
commit e7fa94c3d3
49 changed files with 642 additions and 413 deletions

View File

@@ -17,6 +17,11 @@ pub mod health_check;
#[serde(rename_all = "camelCase")]
#[serde(rename_all_fields = "camelCase")]
pub enum MainStatus {
Error {
on_rebuild: StartStop,
message: String,
debug: Option<String>,
},
Stopped,
Restarting,
Restoring,
@@ -43,12 +48,20 @@ impl MainStatus {
| MainStatus::Restarting
| MainStatus::BackingUp {
on_complete: StartStop::Start,
}
| MainStatus::Error {
on_rebuild: StartStop::Start,
..
} => true,
MainStatus::Stopped
| MainStatus::Restoring
| MainStatus::Stopping { .. }
| MainStatus::BackingUp {
on_complete: StartStop::Stop,
}
| MainStatus::Error {
on_rebuild: StartStop::Stop,
..
} => false,
}
}
@@ -70,7 +83,8 @@ impl MainStatus {
| MainStatus::Stopped
| MainStatus::Restoring
| MainStatus::Stopping { .. }
| MainStatus::Restarting => None,
| MainStatus::Restarting
| MainStatus::Error { .. } => None,
}
}
}