wip
This commit is contained in:
@@ -22,8 +22,7 @@ ENABLE_WATCHDOG = os.getenv("NO_WATCHDOG") is None
|
||||
|
||||
def nativelauncher(pargs: list[str], cwd: str, name: str, log_path: str) -> None:
|
||||
os.environ['MANAGER_DAEMON'] = name
|
||||
log_file_path = os.path.join(log_path, f"{name}.log")
|
||||
with open(log_file_path, 'a') as log_file:
|
||||
with open(log_path, 'a') as log_file:
|
||||
os.chdir(cwd)
|
||||
proc = subprocess.Popen(pargs, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True)
|
||||
for line in proc.stdout:
|
||||
@@ -38,8 +37,7 @@ def launcher(proc: str, name: str, log_path: str) -> None:
|
||||
messaging.context = messaging.Context()
|
||||
cloudlog.bind(daemon=name)
|
||||
sentry.set_tag("daemon", name)
|
||||
log_file_path = os.path.join(log_path, f"{name}.log")
|
||||
with open(log_file_path, 'a') as log_file, subprocess.Popen(['python', '-m', proc], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True) as proc:
|
||||
with open(log_path, 'a') as log_file, subprocess.Popen(['python', '-m', proc], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, universal_newlines=True) as proc:
|
||||
for line in proc.stdout:
|
||||
print(line, end='')
|
||||
log_file.write(line)
|
||||
|
||||
Reference in New Issue
Block a user