|
183 | 183 | temp-outputs (step :temp-outputs)
|
184 | 184 | temp-input-map-lookup (parse-tree :temp-input-map-lookup)
|
185 | 185 | [existing-temp-outputs empty-temp-outputs] (split-with data-in? temp-outputs)
|
186 |
| - empty-temp-output-step-deps (map (comp temp-input-map-lookup normalized-path) empty-temp-outputs) |
187 |
| - empty-temp-output-step-deps (flatten empty-temp-output-step-deps) |
188 |
| - empty-temp-output-step-deps (filter step-set empty-temp-output-step-deps) |
189 |
| - expanded-temp-outputs (map (comp (partial expand-outputs parse-tree step-list) steps) |
190 |
| - empty-temp-output-step-deps) |
191 |
| - expanded-temp-outputs (flatten expanded-temp-outputs) |
192 |
| - ] |
| 186 | + empty-temp-output-step-deps (->> empty-temp-outputs |
| 187 | + (map (comp temp-input-map-lookup normalized-path)) |
| 188 | + flatten |
| 189 | + (filter step-set)) |
| 190 | + expanded-temp-outputs (->> empty-temp-output-step-deps |
| 191 | + (map (comp (partial expand-outputs parse-tree step-list) steps)) |
| 192 | + flatten)] |
193 | 193 | (trace "expand-outputs step:" step)
|
194 | 194 | (trace "expand-outputs step-list:" step-list)
|
195 | 195 | (trace "expand-outputs existing-temp-outputs:" existing-temp-outputs)
|
|
617 | 617 | (when (not (empty? trimmed-deps))
|
618 | 618 | (future
|
619 | 619 | (try
|
620 |
| - (trace "Running future for file" file "deps" trimmed-deps) |
| 620 | + (trace "Running future to delete target:" file "dependencies:" trimmed-deps) |
621 | 621 | (let [successful-deps-count (reduce +
|
622 | 622 | (map (fn [i]
|
623 | 623 | @((steps-map i) :promise))
|
624 | 624 | trimmed-deps))]
|
625 |
| - (trace "Finished waiting for dependents of file" |
| 625 | + (trace "Finished waiting for dependents of target:" |
626 | 626 | file
|
627 |
| - "deps" |
| 627 | + "dependencies:" |
628 | 628 | trimmed-deps
|
629 |
| - "successful-count" |
| 629 | + "successful-count:" |
630 | 630 | successful-deps-count)
|
631 | 631 | (when (= successful-deps-count (count trimmed-deps))
|
632 |
| - (info "Deleting temp file:" file) |
| 632 | + (info "Deleting temp target:" file) |
633 | 633 | (fs di/rm file)))
|
634 | 634 | (catch Exception e
|
635 |
| - (error e "Future for file" file "Caught exception"))))))))) |
| 635 | + ; Likely to happen if there is some problem with deleting the file. |
| 636 | + ; Catch the exception and inform the user of the problem, |
| 637 | + ; but do not hald execution as deletion of the file is probably not |
| 638 | + ; critical to the workflow. |
| 639 | + (error e "Exception deleting temp target:" file))))))))) |
636 | 640 |
|
637 | 641 | (defn- run-steps-async
|
638 | 642 | "Runs steps asynchronously.
|
|
662 | 666 | assoc-promise
|
663 | 667 | (assoc-function parse-tree))]
|
664 | 668 |
|
665 |
| - (when (not (:keep-temp-files *options*)) |
| 669 | + (when (not (:keep-temp-targets *options*)) |
666 | 670 | (setup-temp-deleting-futures parse-tree steps-future))
|
667 | 671 |
|
668 | 672 | (post event-bus (EventWorkflowBegin steps-data))
|
|
995 | 999 | "Turn on even more verbose debugging output.")
|
996 | 1000 | (no-arg version
|
997 | 1001 | "Show version information.")
|
998 |
| - (no-arg keep-temp-files |
999 |
| - "Do not auto-delete temp files") |
| 1002 | + (no-arg keep-temp-targets |
| 1003 | + "Do not auto-delete temp targets") |
1000 | 1004 | (with-arg tmpdir
|
1001 | 1005 | "Specifies the temporary directory for Drake files (by default, .drake/ in the same directory the main workflow file is located)."
|
1002 | 1006 | :type :str
|
|
0 commit comments