mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 06:46:32 +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.
|
/// This also verifies that IO is not running during the export.
|
||||||
async fn export_database(context: &Context, dest: &Path, passphrase: String) -> Result<()> {
|
async fn export_database(context: &Context, dest: &Path, passphrase: String) -> Result<()> {
|
||||||
ensure!(
|
ensure!(
|
||||||
context.scheduler.read().await.is_none(),
|
!context.scheduler.is_running().await,
|
||||||
"cannot export backup, IO is running"
|
"cannot export backup, IO is running"
|
||||||
);
|
);
|
||||||
let now = time().try_into().context("32-bit UNIX time overflow")?;
|
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."
|
"Cannot import backups to accounts in use."
|
||||||
);
|
);
|
||||||
ensure!(
|
ensure!(
|
||||||
context.scheduler.read().await.is_none(),
|
!context.scheduler.is_running().await,
|
||||||
"cannot import backup, IO is running"
|
"cannot import backup, IO is running"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user