summaryrefslogtreecommitdiff
path: root/src/Job.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-06-28 09:46:28 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-06-28 11:49:47 +0200
commit126d17c96fe0730e4ae8775ca2cd4f666b6e7d61 (patch)
tree1f75ba06473c467e61608802a07aa5a84291e8be /src/Job.hs
parenta9ca7d47f22b37c43ac97f1f04181fe114f3ce58 (diff)
Do not copy job error details to JobFinished message
Diffstat (limited to 'src/Job.hs')
-rw-r--r--src/Job.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Job.hs b/src/Job.hs
index 5435cbd..ee901ee 100644
--- a/src/Job.hs
+++ b/src/Job.hs
@@ -90,11 +90,16 @@ textJobStatus = \case
JobWaiting _ -> "waiting"
JobRunning -> "running"
JobSkipped -> "skipped"
- JobError err -> "error\n" <> footnoteText err
+ JobError _ -> "error"
JobFailed -> "failed"
JobCancelled -> "cancelled"
JobDone _ -> "done"
+textJobStatusDetails :: JobStatus a -> Text
+textJobStatusDetails = \case
+ JobError err -> footnoteText err <> "\n"
+ _ -> ""
+
data JobManager = JobManager
{ jmSemaphore :: TVar Int
@@ -282,7 +287,7 @@ updateStatusFile path outVar = void $ liftIO $ forkIO $ loop Nothing
status <- readTVar outVar
when (Just status == prev) retry
return status
- T.writeFile path $ textJobStatus status <> "\n"
+ T.writeFile path $ textJobStatus status <> "\n" <> textJobStatusDetails status
when (not (jobStatusFinished status)) $ loop $ Just status
jobStorageSubdir :: JobId -> FilePath