ntf: fix endless worker loop (#1345)

This commit is contained in:
spaced4ndy
2024-09-30 18:29:14 +04:00
committed by GitHub
parent a9576935cf
commit e808825c95

View File

@@ -1868,6 +1868,7 @@ withWork c doWork getWork action =
withWorkItems :: AgentClient -> TMVar () -> (DB.Connection -> IO (Either StoreError [Either StoreError a])) -> (NonEmpty a -> AM ()) -> AM ()
withWorkItems c doWork getWork action = do
withStore' c getWork >>= \case
Right [] -> noWork
Right rs -> do
let (errs, items) = partitionEithers rs
case L.nonEmpty items of