fix for job cleanup issue

git-svn-id: file:///home/svn/incoming/trunk@3305 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2006-01-05 01:54:38 +00:00
parent a590caaf77
commit 65e987c4e1
1 changed files with 13 additions and 4 deletions

View File

@ -26,12 +26,21 @@ class Job
#
def start(async = false)
if (async)
run_proc.call(ctx)
begin
run_proc.call(ctx)
rescue ::Exception
container.stop_job(jid)
raise $!
end
else
self.job_thread = Thread.new {
run_proc.call(ctx)
clean_proc.call(ctx)
remove_job(self)
begin
run_proc.call(ctx)
ensure
clean_proc.call(ctx)
remove_job(self)
end
}
end
end