MCPcopy Create free account
hub / github.com/acidicoala/SmokeAPI / save_dlcs

Function save_dlcs

static/smoke_api/cache.cpp:34–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 }
33
34 bool save_dlcs(AppId_t app_id, const std::vector<DLC>& dlcs) noexcept {
35 static std::mutex section;
36 const std::lock_guard lock(section);
37
38 try {
39 LOG_DEBUG("Caching DLC IDs for the app: {}", app_id);
40
41 auto apps = get_cached_apps();
42
43 apps[std::to_string(app_id)] = App{.dlcs = DLC::get_dlc_map_from_vector(dlcs)};
44
45 return koalabox::cache::put(KEY_APPS, nlohmann::json(apps));
46 } catch(const std::exception& e) {
47 LOG_ERROR("Error saving DLCs to disk cache: {}", e.what());
48
49 return false;
50 }
51 }
52}

Callers 1

fetch_and_cache_dlcsFunction · 0.85

Calls 1

get_cached_appsFunction · 0.85

Tested by

no test coverage detected