summaryrefslogtreecommitdiff
path: root/src/Command
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-01-10 22:21:14 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-01-10 22:21:14 +0100
commit654edd780dfd28b3611e42df9fd7fd68b8f88191 (patch)
tree01747437b15ad3740637fbdef986546e07fa8d1a /src/Command
parentded067166901805bba63a35b37fe83ebfc4e6aa8 (diff)
Limit number of concurrently running jobsdevel
Changelog: Configurable number of concurrently running jobs
Diffstat (limited to 'src/Command')
-rw-r--r--src/Command/Run.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Command/Run.hs b/src/Command/Run.hs
index 73baee0..a2436c8 100644
--- a/src/Command/Run.hs
+++ b/src/Command/Run.hs
@@ -44,6 +44,7 @@ instance Command RunCommand where
cmdRun :: RunCommand -> CommandExec ()
cmdRun (RunCommand changeset) = do
+ CommonOptions {..} <- getCommonOptions
( base, tip ) <- case T.splitOn (T.pack "..") changeset of
base : tip : _ -> return ( T.unpack base, T.unpack tip )
[ param ] -> liftIO $ do
@@ -56,6 +57,7 @@ cmdRun (RunCommand changeset) = do
[] -> error "splitOn should not return empty list"
liftIO $ do
+ mngr <- newJobManager optJobs
Just repo <- openRepo "."
commits <- listCommits repo (base <> ".." <> tip)
jobssets <- mapM loadJobSetForCommit commits
@@ -72,7 +74,7 @@ cmdRun (RunCommand changeset) = do
shortDesc = fitToLength 50 (commitDescription commit)
case jobsetJobsEither jobset of
Right jobs -> do
- outs <- runJobs "./.minici" commit jobs
+ outs <- runJobs mngr "./.minici" commit jobs
let findJob name = snd <$> find ((name ==) . jobName . fst) outs
displayStatusLine shortCid (" " <> shortDesc) $ map findJob names
Left err -> do