mirror of
https://github.com/Xinrea/bili-shadowreplay.git
synced 2025-11-24 20:15:34 +08:00
fix: processing-task not set failed after app restart (#227)
This commit is contained in:
@@ -99,9 +99,11 @@ impl Database {
|
||||
|
||||
pub async fn finish_pending_tasks(&self) -> Result<(), DatabaseError> {
|
||||
let lock = self.db.read().await.clone().unwrap();
|
||||
let _ = sqlx::query("UPDATE tasks SET status = 'failed' WHERE status = 'pending'")
|
||||
.execute(&lock)
|
||||
.await?;
|
||||
let _ = sqlx::query(
|
||||
"UPDATE tasks SET status = 'failed' WHERE status = 'pending' or status = 'processing'",
|
||||
)
|
||||
.execute(&lock)
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user