diff --git a/pkg/workers/send_work.go b/pkg/workers/send_work.go index ad0743b9..5f39a3d4 100644 --- a/pkg/workers/send_work.go +++ b/pkg/workers/send_work.go @@ -80,15 +80,7 @@ func tryWorkersRoundRobin(node *masa.OracleNode, workers []Worker, message *mess logrus.Info("Attempting local worker") return tryWorker(node, *localWorker, message, responseCollector) } - - // If no workers are available, create a local worker as last resort - logrus.Warn("No workers available, creating last resort local worker") - lastResortLocalWorker := Worker{ - IsLocal: true, - NodeData: pubsub.NodeData{PeerId: node.Host.ID()}, - Node: node, - } - return tryWorker(node, lastResortLocalWorker, message, responseCollector) + return false } func tryWorker(node *masa.OracleNode, worker Worker, message *messages.Work, responseCollector chan *pubsub2.Message) bool { diff --git a/pkg/workers/worker_selection.go b/pkg/workers/worker_selection.go index faddb849..735e5e65 100644 --- a/pkg/workers/worker_selection.go +++ b/pkg/workers/worker_selection.go @@ -134,7 +134,6 @@ func (r *roundRobinIterator) Next() Worker { if hasLocalWorker { return localWorker } - - // This should never happen if HasNext() is checked before calling Next() - panic("No workers available") + logrus.Error("No workers available") + return Worker{} }