From aba5bba9cd250f61d025393e9a1a9caf3aea067f Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Thu, 16 Nov 2023 19:30:19 +0100 Subject: [PATCH] Move work back to queue it is not outoftries --- app/src/main/scala/Executor.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/scala/Executor.scala b/app/src/main/scala/Executor.scala index 1b13a41..7e0342e 100644 --- a/app/src/main/scala/Executor.scala +++ b/app/src/main/scala/Executor.scala @@ -58,9 +58,9 @@ object Executor: def updateOrGiveUp(state: State, move: Work.Move): (State, IO[Unit]) = val newState = state - move.id val io = if move.isOutOfTries then - workQueue.offer(move) - else IO.unit + else + workQueue.offer(move.copy(tries = move.tries + 1)) newState -> io // report not found