File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -192,9 +192,11 @@ async def heartbeat(self):
192192 return
193193 # only escalate, if the server was not stopped (maybe the process was manually shut down)
194194 if server .status != Status .STOPPED :
195- now = datetime .now (timezone .utc )
196- shutil .copy2 (os .path .join (server .instance .home , 'Logs' , 'dcs.log' ),
197- os .path .join (server .instance .home , 'Logs' , f"dcs-{ now .strftime ('%Y%m%d-%H%M%S' )} .log" ))
195+ logfile = os .path .join (server .instance .home , 'Logs' , 'dcs.log' )
196+ if os .path .exists (logfile ):
197+ now = datetime .now (timezone .utc )
198+ shutil .copy2 (logfile , os .path .join (server .instance .home ,
199+ 'Logs' , f"dcs-{ now .strftime ('%Y%m%d-%H%M%S' )} .log" ))
198200 title = f'Server "{ server .name } " died!'
199201 message = 'Setting state to SHUTDOWN.'
200202 self .log .warning (title + ' ' + message )
You can’t perform that action at this time.
0 commit comments