stop leaking sockets/jobs when using rerun on aux modules
git-svn-id: file:///home/svn/framework3/trunk@10014 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
3a0402de2a
commit
d848732254
|
@ -83,18 +83,23 @@ class Auxiliary
|
|||
# Reloads an auxiliary module and executes it
|
||||
#
|
||||
def cmd_rerun(*args)
|
||||
begin
|
||||
if mod.job_id
|
||||
print_status("Stopping existing job...")
|
||||
|
||||
framework.jobs.stop_job(mod.job_id)
|
||||
mod.job_id = nil
|
||||
end
|
||||
|
||||
omod = self.mod
|
||||
self.mod = framework.modules.reload_module(mod)
|
||||
|
||||
if(not self.mod)
|
||||
print_error("Failed to reload module: #{framework.modules.failed[omod.file_path]}")
|
||||
self.mod = omod
|
||||
return
|
||||
end
|
||||
|
||||
cmd_run(*args)
|
||||
rescue
|
||||
log_error("Failed to rerun: #{$!}")
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue