MCPcopy Create free account
hub / github.com/ResearAI/DeepReviewer-v2 / _spawn_worker

Function _spawn_worker

main.py:82–105  ·  view source on GitHub ↗
(job_id: str)

Source from the content-addressed store, hash-verified

80
81
82def _spawn_worker(job_id: str) -> int:
83 here = Path(__file__).resolve()
84 root = here.parent
85 logs_dir = job_dir(job_id)
86 stdout_path = logs_dir / 'worker.stdout.log'
87 stderr_path = logs_dir / 'worker.stderr.log'
88
89 stdout_f = stdout_path.open('ab')
90 stderr_f = stderr_path.open('ab')
91
92 try:
93 process = subprocess.Popen(
94 [sys.executable, str(here), '_run-job', '--job-id', str(job_id)],
95 cwd=str(root),
96 start_new_session=True,
97 stdout=stdout_f,
98 stderr=stderr_f,
99 )
100 finally:
101 stdout_f.close()
102 stderr_f.close()
103
104 append_event(job_id, 'worker_spawned', pid=process.pid)
105 return process.pid
106
107
108def cmd_submit(args: argparse.Namespace) -> int:

Callers 1

cmd_submitFunction · 0.85

Calls 3

job_dirFunction · 0.90
append_eventFunction · 0.90
closeMethod · 0.80

Tested by

no test coverage detected