mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-18 16:39:28 +00:00
perf: 支持终断批量快捷命令执行的任务
This commit is contained in:
@@ -555,10 +555,12 @@ class JobExecution(JMSOrgBaseModel):
|
||||
ssh_tunnel.local_gateway_clean(runner)
|
||||
|
||||
def stop(self):
|
||||
from ops.signal_handlers import job_execution_stop_pub_sub
|
||||
|
||||
with open(os.path.join(self.private_dir, 'local.pid')) as f:
|
||||
try:
|
||||
pid = f.read()
|
||||
os.kill(int(pid), 9)
|
||||
job_execution_stop_pub_sub.publish(int(pid))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
self.set_error('Job stop by "kill -9 {}"'.format(pid))
|
||||
|
Reference in New Issue
Block a user