Updates to artist credit handling
This commit is contained in:
@@ -63,3 +63,12 @@ pub async fn purge_expired(db: &DatabaseConnection) -> DbResult<u64> {
|
||||
.await?;
|
||||
Ok(result.rows_affected)
|
||||
}
|
||||
|
||||
/// Delete all cache entries whose key starts with the given prefix.
|
||||
pub async fn purge_prefix(db: &DatabaseConnection, prefix: &str) -> DbResult<u64> {
|
||||
let result = SearchCache::delete_many()
|
||||
.filter(search_cache::Column::QueryKey.starts_with(prefix))
|
||||
.exec(db)
|
||||
.await?;
|
||||
Ok(result.rows_affected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user