From a1e28888540d9dbc4da6330109091ee37a8e3211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 6 Mar 2025 22:30:35 +0100 Subject: Explicit Tree type for use in checkout --- src/Job.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Job.hs') diff --git a/src/Job.hs b/src/Job.hs index cf7dde8..261d038 100644 --- a/src/Job.hs +++ b/src/Job.hs @@ -180,10 +180,10 @@ runManagedJob JobManager {..} tid cancel job = bracket acquire release $ \case runJobs :: JobManager -> Commit -> [ Job ] -> IO [ ( Job, TVar (JobStatus JobOutput) ) ] runJobs mngr@JobManager {..} commit jobs = do - treeId <- getTreeId commit + tree <- getCommitTree commit results <- atomically $ do forM jobs $ \job -> do - let jid = JobId [ JobIdTree treeId, JobIdName (jobName job) ] + let jid = JobId [ JobIdTree (treeId tree), JobIdName (jobName job) ] tid <- reserveTaskId mngr managed <- readTVar jmJobs ( job, tid, ) <$> case M.lookup jid managed of @@ -282,10 +282,10 @@ updateStatusFile path outVar = void $ liftIO $ forkIO $ loop Nothing prepareJob :: (MonadIO m, MonadMask m, MonadFail m) => FilePath -> Commit -> Job -> (FilePath -> FilePath -> m a) -> m a prepareJob dir commit job inner = do withSystemTempDirectory "minici" $ \checkoutPath -> do - checkoutAt commit checkoutPath - tid <- getTreeId commit + tree <- getCommitTree commit + checkoutAt tree checkoutPath - let jdir = dir "jobs" showTreeId tid stringJobName (jobName job) + let jdir = dir "jobs" showTreeId (treeId tree) stringJobName (jobName job) liftIO $ createDirectoryIfMissing True jdir inner checkoutPath jdir -- cgit v1.2.3