Skip to content

Commit 5308b66

Browse files
committed
Add more logging to causal diff queue workers.
1 parent f4b9869 commit 5308b66

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

share-api/src/Share/BackgroundJobs/Diffs/CausalDiffs.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ processDiff authZReceipt unisonRuntime = Trace.withSpan "background:causal-diffs
5757
DQ.claimCausalDiff >>= \case
5858
Nothing -> pure Nothing
5959
Just causalDiffInfo -> withTags (causalDiffTags causalDiffInfo) do
60+
Logging.textLog ("Computing causal diff: " <> tShow causalDiffInfo)
61+
& Logging.withSeverity Logging.Info
62+
& Logging.logMsg
6063
PG.transactionUnsafeIO $ UnliftIO.tryPutMVar pendingCausalDiffVar causalDiffInfo
6164
startTime <- PG.transactionUnsafeIO (Clock.getTime Clock.Monotonic)
6265
result <- PG.catchTransaction (maybeComputeAndStoreCausalDiff authZReceipt unisonRuntime causalDiffInfo)
66+
Logging.textLog ("Finished causal diff: " <> tShow causalDiffInfo)
67+
& Logging.withSeverity Logging.Info
68+
& Logging.logMsg
6369
DQ.deleteClaimedCausalDiff causalDiffInfo
6470
pure (Just (causalDiffInfo, startTime, result))
6571
case result of

share-api/src/Share/BackgroundJobs/Diffs/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data CausalDiffInfo = CausalDiffInfo
99
toCausalId :: CausalId,
1010
fromCodebaseOwner :: UserId,
1111
toCodebaseOwner :: UserId
12-
}
12+
} deriving (Eq, Show)
1313

1414
instance PG.DecodeRow CausalDiffInfo where
1515
decodeRow =

0 commit comments

Comments
 (0)