Skip to content

Commit

Permalink
wipe temp files on start
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmogul committed Aug 12, 2023
1 parent e277a17 commit 75c8792
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/toolbox/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,22 @@ def run_rewards_collector() -> None:
return


def clear_temp_files() -> None:
tmp_files = ["/tmp/hmy", "/tmp/harmony"]

for tmp_file in tmp_files:
try:
os.remove(tmp_file)
except FileNotFoundError:
pass # Silently ignore if file doesn't exist
except Exception as e:
# You can still log or handle other exceptions if desired
pass


def safety_defaults() -> None:
# clean files
clear_temp_files()
# default settings section
set_var(EnvironmentVariables.dotenv_file, "EASY_VERSION", EnvironmentVariables.easy_version)
if environ.get("GAS_RESERVE") is None:
Expand Down

0 comments on commit 75c8792

Please sign in to comment.