Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
fix: panic if there are no workers
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Jun 25, 2024
1 parent a39f16c commit f4ca750
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions worker_watcher/worker_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ func (ww *WorkerWatcher) wait(w *worker.Process) {
err = ww.Allocate()
if err != nil {
ww.log.Error("failed to allocate the worker", zap.String("internal_event_name", events.EventWorkerError.String()), zap.Error(err))
if atomic.LoadUint64(&ww.numWorkers) == 0 {
panic("no workers available, can't run the application")
}

return
}

Expand Down

0 comments on commit f4ca750

Please sign in to comment.