MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / _load_release_cache

Method _load_release_cache

plugin_manager/github_source.cpp:361–376  ·  view source on GitHub ↗

Doing this because GitHub rate limits after only 60 requests per hour

Source from the content-addressed store, hash-verified

359
360// Doing this because GitHub rate limits after only 60 requests per hour
361void GitHubSource::_load_release_cache() {
362 MutexLock lock(cache_mutex);
363 auto file = _get_release_cache_file_name();
364 if (!FileAccess::exists(file)) {
365 return;
366 }
367 auto fa = FileAccess::open(file, FileAccess::READ);
368 ERR_FAIL_COND_MSG(fa.is_null(), "Failed to open file for reading: " + file);
369 String json = fa->get_as_text();
370 Dictionary d = JSON::parse_string(json);
371 for (auto &E : d.keys()) {
372 String plugin_name = E;
373 Dictionary plugin_dict = d[plugin_name];
374 release_cache[plugin_name] = GHReleaseCache::from_json(plugin_dict);
375 }
376}
377
378void GitHubSource::_save_release_cache() {
379 MutexLock lock(cache_mutex);

Callers

nothing calls this directly

Calls 2

from_jsonFunction · 0.85
get_as_textMethod · 0.80

Tested by

no test coverage detected