ref(scheduler): Make InnerSchedulerState an enum (#4251)

This is more verbose, but makes reasoning about things easier.
This commit is contained in:
Floris Bruynooghe
2023-04-03 11:13:44 +02:00
committed by GitHub
parent 40b072711e
commit c6c20d8f3c
4 changed files with 109 additions and 47 deletions

View File

@@ -97,7 +97,7 @@ impl BackupProvider {
// Acquire global "ongoing" mutex.
let cancel_token = context.alloc_ongoing().await?;
let paused_guard = context.scheduler.pause(context.clone()).await;
let paused_guard = context.scheduler.pause(context.clone()).await?;
let context_dir = context
.get_blobdir()
.parent()
@@ -386,7 +386,7 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
!context.is_configured().await?,
"Cannot import backups to accounts in use."
);
let _guard = context.scheduler.pause(context.clone()).await;
let _guard = context.scheduler.pause(context.clone()).await?;
// Acquire global "ongoing" mutex.
let cancel_token = context.alloc_ongoing().await?;