diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-06 22:30:35 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-06 22:47:25 +0100 |
commit | a1e28888540d9dbc4da6330109091ee37a8e3211 (patch) | |
tree | 318fa32efb3095f57008ad9f749239fa238fab59 /src/Job.hs | |
parent | f056139f1d4b8bbd5ac71b0186541be62bb0e80a (diff) |
Explicit Tree type for use in checkout
Diffstat (limited to 'src/Job.hs')
-rw-r--r-- | src/Job.hs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |