inoki-giskard commited on
Commit
029ed97
1 Parent(s): fc361e6

Force to kill the project

Browse files
Files changed (1) hide show
  1. run_jobs.py +4 -2
run_jobs.py CHANGED
@@ -163,11 +163,13 @@ def pop_job_from_pipe():
163
  p = subprocess.Popen(command, stdout=log_file, stderr=subprocess.STDOUT)
164
  while pipe.current and not return_code:
165
  # Wait for finishing
166
- return_code = p.wait(timeout=1)
 
 
 
167
 
168
  if not pipe.current:
169
  # Job interrupted before finishing
170
- p.terminate()
171
  p.kill()
172
 
173
  log_file.write(f"\nJob interrupted by admin at {time.asctime()}\n")
 
163
  p = subprocess.Popen(command, stdout=log_file, stderr=subprocess.STDOUT)
164
  while pipe.current and not return_code:
165
  # Wait for finishing
166
+ try:
167
+ return_code = p.wait(timeout=1)
168
+ except subprocess.TimeoutExpired:
169
+ return_code = None
170
 
171
  if not pipe.current:
172
  # Job interrupted before finishing
 
173
  p.kill()
174
 
175
  log_file.write(f"\nJob interrupted by admin at {time.asctime()}\n")