Permalink
Browse files

Show jobs as 'waiting to run' if we're waiting for another job to fin…

…ish.
  • Loading branch information...
1 parent e9bea6e commit b9f56a1162553ef6228eb8ec4aac032e9342b152 @marktriggs marktriggs committed Aug 30, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/marcgrep/core.clj
View
@@ -227,10 +227,12 @@
(while (>= (count (filter (complement future-done?) current-jobs))
(:max-concurrent-jobs @config))
;; sit around and wait for a job to finish
+ (doseq [job (filter #(= (:status @%) :not-started) @job-queue)]
+ (swap! job assoc :status :waiting))
(Thread/sleep 5000))
;; Snapshot the job queue and mark those jobs as running
- (when-let [jobs (seq (filter #(= (:status @%) :not-started)
+ (when-let [jobs (seq (filter #(#{:not-started :waiting} (:status @%))
@job-queue))]
(doseq [job jobs] (swap! job assoc :status :running))
@@ -275,6 +277,7 @@
(def status-text {:not-started "Not started"
+ :waiting "Waiting to run"
:running "Running"
:completed "Finished!"})

0 comments on commit b9f56a1

Please sign in to comment.