mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
scheduler: make Scheduler stateless
Scheduler has no Stopped state anymore. If Scheduler exists, it is always started. Scheduler is stopped via Scheduler.stop(), which consumes Scheduler and cannot fail.
This commit is contained in:
@@ -445,8 +445,8 @@ async fn import_backup(
|
||||
"Cannot import backups to accounts in use."
|
||||
);
|
||||
ensure!(
|
||||
!context.scheduler.read().await.is_running(),
|
||||
"cannot import backup, IO already running"
|
||||
context.scheduler.read().await.is_none(),
|
||||
"cannot import backup, IO is running"
|
||||
);
|
||||
|
||||
let backup_file = File::open(backup_to_import).await?;
|
||||
@@ -563,8 +563,8 @@ async fn export_backup(context: &Context, dir: &Path, passphrase: String) -> Res
|
||||
.ok();
|
||||
|
||||
ensure!(
|
||||
!context.scheduler.read().await.is_running(),
|
||||
"cannot export backup, IO already running"
|
||||
context.scheduler.read().await.is_none(),
|
||||
"cannot export backup, IO is running"
|
||||
);
|
||||
|
||||
info!(
|
||||
|
||||
Reference in New Issue
Block a user