mylog timeout, merges

This commit is contained in:
Jokob-sk
2023-09-05 07:53:47 +10:00
parent 28df1e6aaf
commit 069522febe
4 changed files with 8 additions and 3 deletions

0
dockerfiles/README_ES.md Normal file → Executable file
View File

0
front/php/server/internetinfo.php Normal file → Executable file
View File

0
pialert/README_ES.md Normal file → Executable file
View File

View File

@@ -48,9 +48,14 @@ def file_print (*args):
result += str(arg)
print(result)
file = open(logPath + "/pialert.log", "a")
file.write(result + '\n')
file.close()
try:
# Set a timeout for opening the file (in seconds)
file_open_timeout = 10
with open(os.path.join(logPath, "pialert.log"), "a", timeout=file_open_timeout) as file:
file.write(result + '\n')
except Exception as e:
print(f"Error opening/writing to the file: {e}")
#-------------------------------------------------------------------------------
def print_log (pText):