@@ -25,8 +25,6 @@ import Share.Web.Authorization qualified as AuthZ
2525import Share.Web.Errors (EntityMissing (.. ))
2626import Share.Web.Share.Diffs.Impl qualified as Diffs
2727import System.Clock qualified as Clock
28- import Unison.Codebase.Runtime (Runtime )
29- import Unison.Symbol (Symbol )
3028
3129-- | Check every 10 minutes if we haven't heard on the notifications channel.
3230-- Just in case we missed a notification.
@@ -44,14 +42,14 @@ worker scope = do
4442-- Process diffs until we run out of them. We claim a diff in a transaction and compute the diff in the same
4543-- transaction, with a row lock on the contribution id (which is skipped by other workers). There's therefore no chance
4644-- that we claim a diff but fail to write the result of computing that diff back to the database.
47- processDiffs :: AuthZ. AuthZReceipt -> Runtime Symbol -> Background ()
45+ processDiffs :: AuthZ. AuthZReceipt -> CR. UnisonRuntime -> Background ()
4846processDiffs authZReceipt unisonRuntime = do
4947 processDiff authZReceipt unisonRuntime >>= \ case
5048 True -> processDiffs authZReceipt unisonRuntime
5149 False -> pure ()
5250
5351-- | Process a diff, then return whether or not we did any work.
54- processDiff :: AuthZ. AuthZReceipt -> Runtime Symbol -> Background Bool
52+ processDiff :: AuthZ. AuthZReceipt -> CR. UnisonRuntime -> Background Bool
5553processDiff authZReceipt unisonRuntime = do
5654 result <- Trace. withSpan " background:causal-diffs:process-diff" mempty $
5755 PG. runTransactionMode PG. RepeatableRead PG. ReadWrite do
@@ -90,7 +88,7 @@ processDiff authZReceipt unisonRuntime = do
9088-- Returns whether or not we did any work.
9189maybeComputeAndStoreCausalDiff ::
9290 AuthZ. AuthZReceipt ->
93- Runtime Symbol ->
91+ CR. UnisonRuntime ->
9492 CausalDiffInfo ->
9593 PG. Transaction EntityMissing Bool
9694maybeComputeAndStoreCausalDiff authZReceipt unisonRuntime (CausalDiffInfo {fromCausalId, toCausalId, fromCodebaseOwner, toCodebaseOwner}) = PG. transactionSpan " maybeComputeAndStoreCausalDiff" mempty $ do
0 commit comments