summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Job.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Job.hs b/src/Job.hs
index 649833a..740a9f8 100644
--- a/src/Job.hs
+++ b/src/Job.hs
@@ -259,8 +259,10 @@ runJobs mngr@JobManager {..} tout jobs rerun = do
atomically $ writeTVar taskStatus status
outputJobFinishedEvent tout taskJob status
+ handlerInstalled <- newEmptyMVar
taskThread <- forkIO $ do
handle handler $ do
+ putMVar handlerInstalled ()
res <- runExceptT $ do
duplicate <- liftIO $ atomically $ do
readTVar taskStatus >>= \case
@@ -305,6 +307,7 @@ runJobs mngr@JobManager {..} tout jobs rerun = do
atomically $ writeTVar taskStatus $ either id id res
outputJobFinishedEvent tout taskJob $ either id id res
+ takeMVar handlerInstalled
return Task {..}
waitForRemainingTasks :: JobManager -> IO ()