summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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