File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,6 +177,10 @@ def mb_to_bytes(megabytes: int) -> int:
177177 logging .getLogger ("uModbus" ).setLevel (logging .WARNING )
178178 logging .getLogger ("websockets" ).setLevel (logging .WARNING )
179179
180+ thread_errors_path = Path (Path (__file__ ).resolve ().parents [2 ]/ "ramdisk" / "thread_errors.log" )
181+ with thread_errors_path .open ("w" ) as f :
182+ f .write ("" )
183+
180184 def threading_excepthook (args ):
181185 with open (RAMDISK_PATH + "thread_errors.log" , "a" ) as f :
182186 f .write ("Uncaught exception in thread:\n " )
Original file line number Diff line number Diff line change @@ -146,7 +146,9 @@ def handler5Min(self):
146146 def handler_midnight (self ):
147147 try :
148148 save_log (LogType .MONTHLY )
149- Path (Path (__file__ ).resolve ().parents [1 ]/ "ramdisk" / "thread_errors.log" ).unlink (missing_ok = True )
149+ thread_errors_path = Path (Path (__file__ ).resolve ().parents [1 ]/ "ramdisk" / "thread_errors.log" )
150+ with thread_errors_path .open ("w" ) as f :
151+ f .write ("" )
150152 except KeyboardInterrupt :
151153 log .critical ("Ausführung durch exit_after gestoppt: " + traceback .format_exc ())
152154 except Exception :
You can’t perform that action at this time.
0 commit comments