aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2025-01-22 00:50:40 +0000
committerArun Isaac2025-01-22 00:50:40 +0000
commit1c1f62b37b0e47ff9f1a1b8eaf4a566a60462732 (patch)
tree0d5b9985642f1bbe9aad525a32434b0715aa2ca6
parent15065f4bb08c92100ff3e2cb159b9ed73612ee2c (diff)
downloadravanan-1c1f62b37b0e47ff9f1a1b8eaf4a566a60462732.tar.gz
ravanan-1c1f62b37b0e47ff9f1a1b8eaf4a566a60462732.tar.lz
ravanan-1c1f62b37b0e47ff9f1a1b8eaf4a566a60462732.zip
workflow: Return correct updated state when polling list states.
We were returning the original input state. That was obviously a catastrophe! I have spent the better part of the day debugging this. I am tired. * ravanan/workflow.scm (workflow-scheduler)[poll]: Return correct updated state when polling list states.
-rw-r--r--ravanan/workflow.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm
index 158edcd..923683e 100644
--- a/ravanan/workflow.scm
+++ b/ravanan/workflow.scm
@@ -329,14 +329,16 @@ and exit if job has failed."
;; Return list states as completed only if all state elements in it are
;; completed.
((list? state)
- (state-let* ((polled-states (state-map poll state)))
+ (state-let* ((polled-state+status (state-map poll state)))
(state-return
- (if (every (lambda (state+status)
- (eq? (state+status-status state+status)
- 'completed))
- polled-states)
- (state+status state 'completed)
- (state+status state 'pending)))))
+ (state+status (map state+status-state
+ polled-state+status)
+ (if (every (lambda (state+status)
+ (eq? (state+status-status state+status)
+ 'completed))
+ polled-state+status)
+ 'completed
+ 'pending)))))
;; Poll job state. Raise an exception if the job has failed.
((command-line-tool-state? state)
(let ((job-state (command-line-tool-state-job-state state)))