From a67297a79305f3cfaafac6215fa8ce797ddd387f Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 23 Apr 2019 10:34:11 -0700 Subject: [PATCH] simpler --- pollen/private/preheat-cache.rkt | 5 ++--- pollen/private/ts.rktd | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pollen/private/preheat-cache.rkt b/pollen/private/preheat-cache.rkt index 5c78c51..5033ab7 100644 --- a/pollen/private/preheat-cache.rkt +++ b/pollen/private/preheat-cache.rkt @@ -21,8 +21,7 @@ (define (preheat-cache starting-dir) (unless (and (path-string? starting-dir) (directory-exists? starting-dir)) (raise-argument-error 'preheat-cache "directory" starting-dir)) - (define max-places (processor-count)) ; number of parallel processes to spawn at a time - (define worker-places (for/list ([i (in-range max-places)]) + (define worker-places (for/list ([i (in-range (processor-count))]) (place ch (let loop () (define result (with-handlers ([exn:fail? (λ (e) #false)]) @@ -45,7 +44,7 @@ ;; compile the paths in groups, so they can be incrementally saved. ;; that way, if there's a failure, the progress is preserved. ;; but the slowest file in a group will prevent further progress. - (for ([path-group (in-list (slice-at uncached-paths max-places))]) + (for ([path-group (in-list (slice-at uncached-paths (length worker-places)))]) (for ([path (in-list path-group)] [wp (in-list worker-places)]) (message (format "caching: ~a" (find-relative-path starting-dir path))) diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index 2f45e7f..321d7b9 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1555998208 +1556040851