lib/tobox/pool/threaded_pool.rb in tobox-0.4.5 vs lib/tobox/pool/threaded_pool.rb in tobox-0.5.0
- old
+ new
@@ -54,9 +54,11 @@
@threads.delete(Thread.current)
if worker.finished? && @running
idx = @workers.index(worker)
+ raise Error, "worker not found" unless idx
+
subst_worker = Worker.new(worker.label, @configuration)
@workers[idx] = subst_worker
subst_thread = start_thread_worker(subst_worker)
@threads << subst_thread
end