mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 10:51:32 +00:00
Fix shared xmlrpc client raising HTTP errors in LogMonitor
This commit is contained in:
parent
9f6418bf60
commit
4815b97200
@ -29,6 +29,7 @@ class LogMonitor(ObserverMixin):
|
|||||||
|
|
||||||
class SendLogWatchdogEventHandler(PatternMatchingWatchdogEventHandler, SupervisorLogMixin):
|
class SendLogWatchdogEventHandler(PatternMatchingWatchdogEventHandler, SupervisorLogMixin):
|
||||||
def __init__(self, process_name):
|
def __init__(self, process_name):
|
||||||
|
self.threadlocalise_supervisor_instance()
|
||||||
self.process_name = process_name
|
self.process_name = process_name
|
||||||
self.procinfo = self.supervisor.getProcessInfo(self.process_name)
|
self.procinfo = self.supervisor.getProcessInfo(self.process_name)
|
||||||
super().__init__([self.procinfo['stdout_logfile'], self.procinfo['stderr_logfile']])
|
super().__init__([self.procinfo['stdout_logfile'], self.procinfo['stderr_logfile']])
|
||||||
@ -41,9 +42,9 @@ class SendLogWatchdogEventHandler(PatternMatchingWatchdogEventHandler, Superviso
|
|||||||
@RateLimiter(rate_per_second=5)
|
@RateLimiter(rate_per_second=5)
|
||||||
def on_modified(self, event):
|
def on_modified(self, event):
|
||||||
self.uplink.send({
|
self.uplink.send({
|
||||||
'key': 'console',
|
'key': 'processlog',
|
||||||
'data': {
|
'data': {
|
||||||
'command': 'writelog',
|
'command': 'new_log',
|
||||||
'stdout': self.read_stdout(self.process_name),
|
'stdout': self.read_stdout(self.process_name),
|
||||||
'stderr': self.read_stderr(self.process_name)
|
'stderr': self.read_stderr(self.process_name)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user