Skip to content

Commit c6ed036

Browse files
committed
Fix up Runtime imports for unison bump
1 parent 2834ddc commit c6ed036

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/Share/BackgroundJobs/Diffs/CausalDiffs.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import Share.Web.Authorization qualified as AuthZ
2525
import Share.Web.Errors (EntityMissing (..))
2626
import Share.Web.Share.Diffs.Impl qualified as Diffs
2727
import 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 ()
4846
processDiffs 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
5553
processDiff 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.
9189
maybeComputeAndStoreCausalDiff ::
9290
AuthZ.AuthZReceipt ->
93-
Runtime Symbol ->
91+
CR.UnisonRuntime ->
9492
CausalDiffInfo ->
9593
PG.Transaction EntityMissing Bool
9694
maybeComputeAndStoreCausalDiff authZReceipt unisonRuntime (CausalDiffInfo {fromCausalId, toCausalId, fromCodebaseOwner, toCodebaseOwner}) = PG.transactionSpan "maybeComputeAndStoreCausalDiff" mempty $ do

src/Share/Codebase/CodebaseRuntime.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Share.Codebase.CodebaseRuntime
22
( withCodebaseRuntime,
3+
UnisonRuntime,
34
)
45
where
56

@@ -8,11 +9,13 @@ import Share.Codebase.CodeCache qualified as CC
89
import Share.Codebase.Types
910
import Share.Postgres qualified as PG
1011
import Share.Prelude
11-
import Unison.Codebase.Runtime (Runtime)
12+
import Unison.Runtime (Runtime)
1213
import Unison.Symbol (Symbol)
1314
import Unison.Term qualified as Term
1415
import UnliftIO qualified
1516

17+
type UnisonRuntime = Runtime Symbol
18+
1619
-- | Construct a Runtime linked to a specific codebase and transaction.
1720
-- Don't use the runtime for one codebase with another codebase.
1821
-- Don't use this runtime in any transaction other than the one where it's created.

src/Share/Codebase/Types.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Share.IDs
1818
import Unison.Codebase.CodeLookup qualified as CL
1919
import Unison.Codebase.Path qualified as Path
2020
import Unison.Codebase.Runtime qualified as Rt
21+
import Unison.Runtime (Runtime)
2122
import Unison.DataDeclaration qualified as V1
2223
import Unison.NameSegment.Internal (NameSegment (..))
2324
import Unison.Parser.Ann (Ann)
@@ -57,7 +58,7 @@ data CodebaseRuntime scope m = CodebaseRuntime
5758
codeCache :: CodeCache scope,
5859
-- Function to look up cached evaluation results for the runtime.
5960
cachedEvalResult :: Reference.Id -> m (Maybe (Rt.Term Symbol)),
60-
unisonRuntime :: Rt.Runtime Symbol
61+
unisonRuntime :: Runtime Symbol
6162
}
6263

6364
hoistCodebaseRuntime :: (Monad m) => (forall x. m x -> n x) -> CodebaseRuntime s m -> CodebaseRuntime s n

src/Share/Env.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Share.Utils.Servant.Cookies qualified as Cookies
1818
import Share.Utils.Tags (HasTags (..))
1919
import System.Log.FastLogger (FormattedTime, LogStr)
2020
import System.Log.Raven.Types (SentryService)
21-
import Unison.Codebase.Runtime (Runtime)
21+
import Unison.Runtime (Runtime)
2222
import Unison.Symbol (Symbol)
2323
import Vault qualified
2424

0 commit comments

Comments
 (0)