mirror of
https://codeberg.org/spire/dispenser.git
synced 2026-06-03 18:14:06 +02:00
fix empty server detection and add option to manage existing instances
This commit is contained in:
parent
da2b13feb1
commit
86adb69a95
4 changed files with 13 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -130,7 +130,15 @@ async fn run_loop(
|
|||
start_schedule: Schedule,
|
||||
stop_schedule: Schedule,
|
||||
) {
|
||||
let mut active_server: Option<Server> = None;
|
||||
let mut active_server = if config.server.manage_existing {
|
||||
cloud
|
||||
.list()
|
||||
.await
|
||||
.map(|servers| servers.into_iter().next())
|
||||
.unwrap_or_default()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
loop {
|
||||
let next_start = start_schedule.upcoming(Utc).next().unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue