Skip to content

Commit

Permalink
Move work back to queue it is not outoftries
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Nov 16, 2023
1 parent 792bf4c commit aba5bba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/scala/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aba5bba

Please sign in to comment.