diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-28 09:46:28 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-06-28 11:49:47 +0200 |
commit | 126d17c96fe0730e4ae8775ca2cd4f666b6e7d61 (patch) | |
tree | 1f75ba06473c467e61608802a07aa5a84291e8be | |
parent | a9ca7d47f22b37c43ac97f1f04181fe114f3ce58 (diff) |
Do not copy job error details to JobFinished message
-rw-r--r-- | src/Job.hs | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 |