From e328158e038beaf02eccc427cc7891304e46ecca Mon Sep 17 00:00:00 2001 From: Muqiu Han Date: Fri, 26 Jul 2024 18:16:09 +0800 Subject: [PATCH] fix WorkerManager queue error --- src/main/scala/core/WorkerManager.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/core/WorkerManager.scala b/src/main/scala/core/WorkerManager.scala index e7472bb..9276fd3 100644 --- a/src/main/scala/core/WorkerManager.scala +++ b/src/main/scala/core/WorkerManager.scala @@ -35,10 +35,8 @@ object WorkerManager extends CheckInitialized: end WorkerManager /// Continuously obtain messages in the queue and forward them to the corresponding channel. -case class Task(id: Int) extends Runnable: - private var _queue: Option[MessageQueue] = None - - inline def queue: MessageQueue = _queue.get +case class Task(index: Int) extends Runnable: + private val queue: MessageQueue = QueueManager.get(index) override def run(): Unit = scribe.info(s"worker thread of queue ${queue.name} is working")