Skip to content

Commit efce396

Browse files
committed
More debugging
1 parent 989e1d1 commit efce396

File tree

1 file changed

+4
-3
lines changed
  • share-api/src/Share/Web/UCM/HistoryComments

1 file changed

+4
-3
lines changed

share-api/src/Share/Web/UCM/HistoryComments/Impl.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ downloadHistoryCommentsStreamImpl _mayUserId _conn = do
4141

4242
-- Re-run the given STM action at most n times, collecting the results into a list.
4343
-- If the action returns Nothing, stop early and return what has been collected so far, along with a Bool indicating whether the action was exhausted.
44-
fetchChunk :: Int -> STM (Maybe a) -> STM ([a], Bool)
44+
fetchChunk :: (Show a) => Int -> STM (Maybe a) -> STM ([a], Bool)
4545
fetchChunk size action = do
4646
let go 0 = pure ([], False)
4747
go n = do
@@ -53,6 +53,7 @@ fetchChunk size action = do
5353
-- Queue is closed
5454
pure ([], True)
5555
Just (Just val) -> do
56+
Debug.debugM Debug.Temp "Fetched value from queue" val
5657
(rest, exhausted) <- go (n - 1)
5758
pure (val : rest, exhausted)
5859
go size
@@ -96,8 +97,8 @@ uploadHistoryCommentsStreamImpl mayCallerUserId br@(BranchRef branchRef) conn =
9697
loop
9798
case result of
9899
Left err -> reportError err
99-
Right (Left err) -> reportError err
100-
Right (Right ()) -> pure ()
100+
Right (Left err, _leftovers) -> reportError err
101+
Right (Right (), _leftovers) -> pure ()
101102
where
102103
insertCommentBatchSize = 100
103104
handleErrInQueue :: forall o x e. Queues (MsgOrError e UploadCommentsResponse) o -> UploadCommentsResponse -> ExceptT UploadCommentsResponse WebApp x

0 commit comments

Comments
 (0)