mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 10:26:29 +03:00
Use scheduler.is_running()
This commit is contained in:
@@ -750,7 +750,7 @@ where
|
||||
/// This also verifies that IO is not running during the export.
|
||||
async fn export_database(context: &Context, dest: &Path, passphrase: String) -> Result<()> {
|
||||
ensure!(
|
||||
context.scheduler.read().await.is_none(),
|
||||
!context.scheduler.is_running().await,
|
||||
"cannot export backup, IO is running"
|
||||
);
|
||||
let now = time().try_into().context("32-bit UNIX time overflow")?;
|
||||
|
||||
@@ -374,7 +374,7 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
|
||||
"Cannot import backups to accounts in use."
|
||||
);
|
||||
ensure!(
|
||||
context.scheduler.read().await.is_none(),
|
||||
!context.scheduler.is_running().await,
|
||||
"cannot import backup, IO is running"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user