diff --git a/lib/tfw/components/mixins/supervisor_mixin.py b/lib/tfw/components/mixins/supervisor_mixin.py index 7023105..e00e728 100644 --- a/lib/tfw/components/mixins/supervisor_mixin.py +++ b/lib/tfw/components/mixins/supervisor_mixin.py @@ -1,6 +1,7 @@ import xmlrpc.client from contextlib import suppress from xmlrpc.client import Fault as SupervisorFault +from os import remove from tfw.config import tfwenv @@ -16,7 +17,10 @@ class SupervisorMixin: self.supervisor.startProcess(process_name) def read_log(self, process_name): - return self.supervisor.readProcessStderrLog(process_name, 0, 0) + logs = self.supervisor.readProcessStderrLog(process_name, 0, 0) + remove(self.supervisor.getProcessInfo(process_name)['stderr_logfile']) + self.supervisor.clearProcessLogs(process_name) + return logs def restart_process(self, process_name): self.stop_process(process_name)