Skip to content

Commit

Permalink
added touch file for Container
Browse files Browse the repository at this point in the history
  • Loading branch information
Wargamer-Senpai committed Dec 8, 2023
1 parent c97891f commit b2976ca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ def func_bot_restart():
func_write_to_log("Couldnt detect OS for proper restart", "CRITICAL", current_function)
exit(255)

#########################################################################
# used when inside container, touch file to refresh change date of file #
#########################################################################
def func_touch_file(filename):
with open(filename, 'a'):
os.utime(filename, None)

##############################################
# check if bot is running inside a container #
Expand Down Expand Up @@ -789,7 +795,10 @@ def func_merge_configs():
func_write_to_log("Startup complete...", "INFO", "startup_finished")
while True:
time.sleep(1)
if func_container_check():
func_touch_file("check_container")


# check for new update of ts client
elapsed_time = time.time() - start_time
if elapsed_time >= interval:
Expand Down

0 comments on commit b2976ca

Please sign in to comment.