mylog timeout, merges
This commit is contained in:
0
dockerfiles/README_ES.md
Normal file → Executable file
0
dockerfiles/README_ES.md
Normal file → Executable file
0
front/php/server/internetinfo.php
Normal file → Executable file
0
front/php/server/internetinfo.php
Normal file → Executable file
0
pialert/README_ES.md
Normal file → Executable file
0
pialert/README_ES.md
Normal file → Executable file
@@ -48,9 +48,14 @@ def file_print (*args):
|
|||||||
result += str(arg)
|
result += str(arg)
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
file = open(logPath + "/pialert.log", "a")
|
try:
|
||||||
file.write(result + '\n')
|
# Set a timeout for opening the file (in seconds)
|
||||||
file.close()
|
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):
|
def print_log (pText):
|
||||||
|
|||||||
Reference in New Issue
Block a user