Skip to content

Commit

Permalink
Remove cache from list to improve response latency for #234
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Apr 24, 2024
1 parent 9dcfa9f commit 26b5eb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data-sources/core/src/cache/DirectoryMediaCacheStorage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ class DirectoryMediaCacheStorage(

override suspend fun delete(cache: MediaCache): Boolean {
lock.withLock {
listFlow.value -= cache
cache.delete()
withContext(Dispatchers.IO) {
if (!metadataDir.resolve(getSaveFilename(cache)).deleteIfExists()) {
logger.error { "Attempting to delete media cache '${cache.cacheId}' but its corresponding metadata file does not exist" }
}
}
listFlow.value -= cache
return true
}
}
Expand Down

0 comments on commit 26b5eb0

Please sign in to comment.