From 8047476af3274e4285e7687c48339fae1c9d6fd7 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 18 Jan 2015 06:53:39 -0700 Subject: [PATCH] manage snapshots: don't fail due to mangled previous build --- distro-build-server/manage-snapshots.rkt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/distro-build-server/manage-snapshots.rkt b/distro-build-server/manage-snapshots.rkt index 53a857f..a16680d 100644 --- a/distro-build-server/manage-snapshots.rkt +++ b/distro-build-server/manage-snapshots.rkt @@ -62,16 +62,20 @@ (define past-successes (let ([current-table (get-installers-table table-file)]) (for/fold ([table (hash)]) ([s (in-list (reverse (remove current-snapshot (get-snapshots))))]) - (define past-table (get-installers-table - (build-path snapshots-dir s installers-dir "table.rktd"))) - (for/fold ([table table]) ([(k v) (in-hash past-table)]) - (if (or (hash-ref current-table k #f) - (hash-ref table k #f) - (not (file-exists? (build-path site-dir "log" k)))) - table - (hash-set table k (past-success s - (string-append s "/index.html") - v))))))) + (with-handlers ([exn:fail? (lambda (exn) + (log-error "failure getting installer table: ~a" + (exn-message exn)) + table)]) + (define past-table (get-installers-table + (build-path snapshots-dir s installers-dir "table.rktd"))) + (for/fold ([table table]) ([(k v) (in-hash past-table)]) + (if (or (hash-ref current-table k #f) + (hash-ref table k #f) + (not (file-exists? (build-path site-dir "log" k)))) + table + (hash-set table k (past-success s + (string-append s "/index.html") + v)))))))) (define current-rx (regexp (regexp-quote (version))))