Use scheduler.is_running()

This commit is contained in:
link2xt
2023-03-19 11:23:09 +00:00
parent 71bb89fac1
commit eb0f896d57
2 changed files with 2 additions and 2 deletions

View File

@@ -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")?;

View File

@@ -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"
);