Skip to content

Commit a38eec6

Browse files
author
Michael Hammann
committed
refactor: aadded set log offset to seperate function
1 parent 2fd4924 commit a38eec6

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

supervisor/process.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,7 @@ def spawn(self, supervisor=None):
217217
return
218218
# if runningregex is used, set the log_offset correctly
219219
if self.config.runningregex is not None:
220-
self._set_log_offset_for_runningregex()
221-
try:
222-
logfile = getattr(self.config, 'stdout_logfile')
223-
with open(logfile, 'rb') as f:
224-
log_file_length = len(f.read())
225-
self.log_offset = log_file_length
226-
except FileNotFoundError:
227-
self.log_offset = 0
220+
self._set_log_offset_for_runningregex()
228221

229222
options = self.config.options
230223
processname = as_string(self.config.name)

supervisor/supervisord.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ def _spawn_dependee_queue(self):
362362
break
363363
if all([dependee.state is ProcessStates.RUNNING for dependee in
364364
process_object.config.depends_on.values()]):
365-
self._spawn_process_from_process_dict()
365+
self._spawn_process_from_process_dict(process_name, process_object)
366366
else:
367-
self._spawn_process_from_process_dict()
367+
self._spawn_process_from_process_dict(process_name, process_object)
368368

369369
def _spawn_process_from_process_dict(self, process_name, process_object):
370370
self.process_started_dict[process_name] = process_object

0 commit comments

Comments
 (0)