diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-19 02:47:47 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-19 02:47:47 +0200 |
| commit | cfedca99842858d28810d3082d4b48aacd8bbc38 (patch) | |
| tree | eba88cfbef0ccc58495fe3be4d8ba500a1f01922 /src/database | |
| parent | fix: Various cron fixes (diff) | |
| download | senator-sperma-cfedca99842858d28810d3082d4b48aacd8bbc38.tar.gz senator-sperma-cfedca99842858d28810d3082d4b48aacd8bbc38.zip | |
fix: clear voice_activity upon starting
this lets stale records from abrupt stopping be deleted
Diffstat (limited to 'src/database')
| -rw-r--r-- | src/database/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs index 0674477..f2185fb 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs | |||
| @@ -12,6 +12,10 @@ pub async fn init_pool(path: &str) -> Result<DbPool> { | |||
| 12 | } | 12 | } |
| 13 | let pool = SqlitePool::connect(&format!("sqlite:{path}?mode=rwc")).await?; | 13 | let pool = SqlitePool::connect(&format!("sqlite:{path}?mode=rwc")).await?; |
| 14 | run_migrations(&pool).await?; | 14 | run_migrations(&pool).await?; |
| 15 | // Clear stale voice activity records from previous run. | ||
| 16 | sqlx::query("DELETE FROM voice_activity") | ||
| 17 | .execute(&pool) | ||
| 18 | .await?; | ||
| 15 | Ok(pool) | 19 | Ok(pool) |
| 16 | } | 20 | } |
| 17 | 21 | ||
