Skip to content

Commit

Permalink
Merge pull request #852 from Spartan322/4.3-fix/rest-gh-ratelimit-file
Browse files Browse the repository at this point in the history
[4.3] Fix `gh_ratelimit`'s creation path being outside Redot
  • Loading branch information
Spartan322 authored Nov 9, 2024
2 parents 361d791 + 9b91d9a commit afc82bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions editor/engine_update_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ void EngineUpdateLabel::_check_update() {
checked_update = true;

if (ratelimit_remaining == UINT64_MAX && ratelimit_reset == UINT64_MAX) {
Ref<FileAccess> gh_ratelimit_file = FileAccess::open(OS::get_singleton()->get_data_path().path_join("gh_ratelimit"), FileAccess::READ);
const String gh_ratelimit_path = OS::get_singleton()->get_data_path().path_join(OS::get_singleton()->get_godot_dir_name()).path_join("gh_ratelimit");
Ref<FileAccess> gh_ratelimit_file = FileAccess::open(gh_ratelimit_path, FileAccess::READ);
if (gh_ratelimit_file.is_valid() && gh_ratelimit_file->is_open()) {
ratelimit_remaining = gh_ratelimit_file->get_64();
ratelimit_reset = gh_ratelimit_file->get_64();
Expand Down Expand Up @@ -87,7 +88,7 @@ void EngineUpdateLabel::_http_request_completed(int p_result, int p_response_cod
}
}

const String gh_ratelimit_path = OS::get_singleton()->get_data_path().path_join("gh_ratelimit");
const String gh_ratelimit_path = OS::get_singleton()->get_data_path().path_join(OS::get_singleton()->get_godot_dir_name()).path_join("gh_ratelimit");
if (ratelimit_remaining == 0) {
Ref<FileAccess> gh_ratelimit_file = FileAccess::open(gh_ratelimit_path, FileAccess::WRITE);
if (gh_ratelimit_file.is_valid() && gh_ratelimit_file->is_open()) {
Expand Down

0 comments on commit afc82bc

Please sign in to comment.