Updates to artist credit handling
This commit is contained in:
@@ -274,4 +274,22 @@ async fn test_search_cache_ttl() {
|
||||
// Purge expired
|
||||
let purged = queries::cache::purge_expired(conn).await.unwrap();
|
||||
assert_eq!(purged, 1);
|
||||
|
||||
// Purge by prefix
|
||||
queries::cache::set(conn, "artist_totals:1", "computed", "[10,5,3]", 3600)
|
||||
.await
|
||||
.unwrap();
|
||||
queries::cache::set(conn, "artist_totals:2", "computed", "[20,10,5]", 3600)
|
||||
.await
|
||||
.unwrap();
|
||||
queries::cache::set(conn, "other_key", "computed", "{}", 3600)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let purged = queries::cache::purge_prefix(conn, "artist_totals:").await.unwrap();
|
||||
assert_eq!(purged, 2);
|
||||
|
||||
// other_key should still exist
|
||||
let result = queries::cache::get(conn, "other_key").await.unwrap();
|
||||
assert!(result.is_some());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user