start of fix

dev-poly-fix-201114
Matthew Butterick 4 years ago
parent 65d2c7edaa
commit 6909c1a8ed

@ -1,4 +1,4 @@
#lang racket/base #lang debug racket/base
(require racket/file (require racket/file
racket/path racket/path
racket/match racket/match
@ -51,6 +51,8 @@
(define (parallel-render source-paths-in output-paths-in job-count-arg) (define (parallel-render source-paths-in output-paths-in job-count-arg)
;; if jobs are already in the cache, pull them out before assigning workers ;; if jobs are already in the cache, pull them out before assigning workers
;; using worker to fetch from cache is slower ;; using worker to fetch from cache is slower
#R source-paths-in
#R output-paths-in
(define source-to-output-path-table (map cons source-paths-in output-paths-in)) (define source-to-output-path-table (map cons source-paths-in output-paths-in))
(define-values (uncached-source-paths previously-cached-jobs) (define-values (uncached-source-paths previously-cached-jobs)
(for/fold ([usps null] (for/fold ([usps null]
@ -190,9 +192,15 @@
(let loop ([paths paths-in] [sps null] [ops null]) (let loop ([paths paths-in] [sps null] [ops null])
(match paths (match paths
[(? null?) [(? null?)
(define (cleanup paths) ;; it's possible that we have multiple output names for one poly file
(sort (remove-duplicates paths) string<? #:key path->string)) ;; so after we expand, we only remove duplicates where both the source and dest in the pair
(apply values (map cleanup (list sps ops)))] ;; are the same
(let* ([pairs (remove-duplicates (map cons sps ops))]
[pairs (sort pairs string<? #:key (compose1 path->string car))]
[pairs (sort pairs string<? #:key (compose1 path->string cdr))])
(for/lists (sps ops)
([pr (in-list pairs)])
(values (car pr) (cdr pr))))]
[(cons path rest) [(cons path rest)
(match (->complete-path path) (match (->complete-path path)
[(? pagetree-source? pt) [(? pagetree-source? pt)

Loading…
Cancel
Save