From e808825c95fd4d306700a9044a3dbeb5fcc0a307 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Mon, 30 Sep 2024 18:29:14 +0400 Subject: [PATCH] ntf: fix endless worker loop (#1345) --- src/Simplex/Messaging/Agent/Client.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Simplex/Messaging/Agent/Client.hs b/src/Simplex/Messaging/Agent/Client.hs index 49198c65e..d2a2554fe 100644 --- a/src/Simplex/Messaging/Agent/Client.hs +++ b/src/Simplex/Messaging/Agent/Client.hs @@ -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