Permalink
Browse files

Catch InterruptedException at a higher level

  • Loading branch information...
1 parent 83b4f14 commit a42f970d0355c5402517300a211d0de63698dc02 Seth Morabito committed Nov 11, 2008
Showing with 8 additions and 4 deletions.
  1. +8 −4 server/lib/bdrb_thread_pool.rb
@@ -54,10 +54,14 @@ def add_thread
Thread.current[:job_key] = nil
Thread.current[:persistent_job_id] = nil
while true
- task = @work_queue.pop
- Thread.current[:job_key] = task.job_key
- Thread.current[:persistent_job_id] = task.persistent_job_id
- block_result = run_task(task)
+ begin
+ task = @work_queue.pop
+ Thread.current[:job_key] = task.job_key
+ Thread.current[:persistent_job_id] = task.persistent_job_id
+ block_result = run_task(task)
+ rescue BackgrounDRb::InterruptedException
+ next
+ end
end
end
end

0 comments on commit a42f970

Please sign in to comment.