stop leaking sockets/jobs when using rerun on aux modules

git-svn-id: file:///home/svn/framework3/trunk@10014 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-08-14 06:47:11 +00:00
parent 3a0402de2a
commit d848732254
1 changed files with 16 additions and 11 deletions

View File

@ -83,18 +83,23 @@ class Auxiliary
# Reloads an auxiliary module and executes it
#
def cmd_rerun(*args)
begin
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: #{$!}")
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)
end
#