Ensure old extension store is removed if index url changes (mihonapp/mihon#3408)
(cherry picked from commit c15f7bee85b8fbe258abe81433730aa5bcba58a1)
This commit is contained in:
parent
5e809fefd4
commit
eb84ab8439
1 changed files with 8 additions and 1 deletions
|
|
@ -40,7 +40,14 @@ class ExtensionStoreRepositoryImpl(
|
||||||
extension_storeQueries.getAll()
|
extension_storeQueries.getAll()
|
||||||
}.forEach { store ->
|
}.forEach { store ->
|
||||||
service.fetch(store.index_url)
|
service.fetch(store.index_url)
|
||||||
.mapCatching { upsert(it) }
|
.mapCatching {
|
||||||
|
handler.await {
|
||||||
|
upsert(it)
|
||||||
|
if (store.index_url != it.indexUrl) {
|
||||||
|
extension_storeQueries.delete(store.index_url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.onFailure {
|
.onFailure {
|
||||||
logcat(LogPriority.ERROR, it) {
|
logcat(LogPriority.ERROR, it) {
|
||||||
"Failed to refresh extension store '${store.name} (${store.index_url})'"
|
"Failed to refresh extension store '${store.name} (${store.index_url})'"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue