mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
release lock on update progress (#1614)
This commit is contained in:
@@ -44,10 +44,14 @@ impl InstallProgress {
|
||||
mut db: Db,
|
||||
) -> Result<(), Error> {
|
||||
while !self.download_complete.load(Ordering::SeqCst) {
|
||||
model.put(&mut db, &self).await?;
|
||||
let mut tx = db.begin().await?;
|
||||
model.put(&mut tx, &self).await?;
|
||||
tx.save().await?;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
model.put(&mut db, &self).await?;
|
||||
let mut tx = db.begin().await?;
|
||||
model.put(&mut tx, &self).await?;
|
||||
tx.save().await?;
|
||||
Ok(())
|
||||
}
|
||||
pub async fn track_download_during<
|
||||
@@ -74,10 +78,14 @@ impl InstallProgress {
|
||||
complete: Arc<AtomicBool>,
|
||||
) -> Result<(), Error> {
|
||||
while !complete.load(Ordering::SeqCst) {
|
||||
model.put(&mut db, &self).await?;
|
||||
let mut tx = db.begin().await?;
|
||||
model.put(&mut tx, &self).await?;
|
||||
tx.save().await?;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
model.put(&mut db, &self).await?;
|
||||
let mut tx = db.begin().await?;
|
||||
model.put(&mut tx, &self).await?;
|
||||
tx.save().await?;
|
||||
Ok(())
|
||||
}
|
||||
pub async fn track_read_during<
|
||||
|
||||
Reference in New Issue
Block a user