mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
server: Add --mode check-config
This commit is contained in:
parent
a3636339e0
commit
0c1f362a62
1 changed files with 6 additions and 0 deletions
|
@ -44,6 +44,9 @@ enum ServerMode {
|
||||||
|
|
||||||
/// Run garbage collection then exit.
|
/// Run garbage collection then exit.
|
||||||
GarbageCollectorOnce,
|
GarbageCollectorOnce,
|
||||||
|
|
||||||
|
/// Check the configuration then exit.
|
||||||
|
CheckConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
@ -95,6 +98,9 @@ async fn main() -> Result<()> {
|
||||||
ServerMode::GarbageCollectorOnce => {
|
ServerMode::GarbageCollectorOnce => {
|
||||||
attic_server::gc::run_garbage_collection_once(config).await?;
|
attic_server::gc::run_garbage_collection_once(config).await?;
|
||||||
}
|
}
|
||||||
|
ServerMode::CheckConfig => {
|
||||||
|
// config is valid, let's just exit :)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue