summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-04-01 20:57:51 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-04-01 20:57:51 +0200
commit007261536b8b5daf1e3cac24eeeb160c6d572c85 (patch)
tree689a5c79aa1355cf40e03d6c0522d0f049253205 /src
parent8615433b8ac8e161c36df9b18d551ceb3949ff1f (diff)
Set exception handler before returning taskHEADmaster
Diffstat (limited to 'src')
-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 ()