Initialise supervisor xmlrpc client lazily to avoid globals

This commit is contained in:
Kristóf Tóth
2018-06-01 14:01:32 +02:00
parent 8817f991a5
commit 9f3a3b501f
2 changed files with 4 additions and 12 deletions

View File

@ -29,7 +29,6 @@ class LogMonitor(ObserverMixin):
class SendLogWatchdogEventHandler(PatternMatchingWatchdogEventHandler, SupervisorLogMixin):
def __init__(self, process_name, log_tail=0):
self.acquire_own_supervisor_instance() # This thread-localises the xmlrpc client
self.process_name = process_name
self.procinfo = self.supervisor.getProcessInfo(self.process_name)
super().__init__([self.procinfo['stdout_logfile'], self.procinfo['stderr_logfile']])