The single global repo lock becomes one lock per marketplace, and refresh_pins takes each marketplace's lock only while setting its pins, so a slow fetch no longer queues installs and refreshes of other marketplaces. refresh_marketplace now takes the lock first and reads the settings store under it (a closure, not a copy captured earlier); a marketplace removed meanwhile gets no cache and no snapshot. Removing a marketplace deletes its snapshot and cache under the same lock (remove_marketplace_cache). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -311,10 +311,14 @@ pub fn run() {
|
||||
// Failures are logged, not toasted — the Marketplace tab shows them.
|
||||
{
|
||||
let settings = settings_store_setup.get();
|
||||
let settings_store = settings_store_setup.clone();
|
||||
let marketplace = marketplace_setup.clone();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
for m in &settings.marketplaces {
|
||||
let snap = crate::marketplace::refresh_marketplace(&marketplace, &settings, &m.id).await;
|
||||
// Reads the store again under the lock: one removed
|
||||
// since startup is skipped (PR review #6).
|
||||
let current = || settings_store.get();
|
||||
let snap = crate::marketplace::refresh_marketplace(&marketplace, ¤t, &m.id).await;
|
||||
if let Some(e) = snap.fetch_error {
|
||||
log::warn!("Marketplace \"{}\" could not be refreshed at startup: {}", m.name, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user