Doing this because GitHub rate limits after only 60 requests per hour
| 359 | |
| 360 | // Doing this because GitHub rate limits after only 60 requests per hour |
| 361 | void 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 | |
| 378 | void GitHubSource::_save_release_cache() { |
| 379 | MutexLock lock(cache_mutex); |
nothing calls this directly
no test coverage detected