diff options
author | Christopher Baines <mail@cbaines.net> | 2021-02-04 10:28:04 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-02-04 10:28:04 +0000 |
commit | 39f52e3a2ea126a08d60e087d1f6b83f8e00f5d4 (patch) | |
tree | 901fe5c542d5426735710552b7a550a8faf8a951 /guix-data-service/web/compare | |
parent | 4c14e161488cf7f69de888da56dcd7b46f49dff6 (diff) | |
download | data-service-39f52e3a2ea126a08d60e087d1f6b83f8e00f5d4.tar data-service-39f52e3a2ea126a08d60e087d1f6b83f8e00f5d4.tar.gz |
Update parse-commit for the guix-revision changes
Diffstat (limited to 'guix-data-service/web/compare')
-rw-r--r-- | guix-data-service/web/compare/controller.scm | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/guix-data-service/web/compare/controller.scm b/guix-data-service/web/compare/controller.scm index a847a1b..a6aa198 100644 --- a/guix-data-service/web/compare/controller.scm +++ b/guix-data-service/web/compare/controller.scm @@ -57,30 +57,33 @@ (parallel-via-thread-pool-channel (with-thread-postgresql-connection (lambda (conn) - (if (guix-commit-exists? conn s) - s - (let* ((job-details - (select-job-for-commit conn s)) - (job-state - (assq-ref job-details 'state))) - (if job-details - (make-invalid-query-parameter - s - (cond - ((string=? job-state "queued") - `("data unavailable, " - (a (@ (href ,(string-append - "/revision/" s))) - "yet to process revision"))) - ((string=? job-state "failed") - `("data unavailable, " - (a (@ (href ,(string-append - "/revision/" s))) - "failed to process revision"))) - (else - "unknown job state"))) - (make-invalid-query-parameter - s "unknown commit")))))))) + (let* ((job-details + (select-job-for-commit conn s)) + (job-state + (assq-ref job-details 'state))) + (if job-details + (cond + ((string=? job-state "succeeded") + s) + ((string=? job-state "queued") + (make-invalid-query-parameter + s + `("data unavailable, " + (a (@ (href ,(string-append + "/revision/" s))) + "yet to process revision")))) + ((string=? job-state "failed") + (make-invalid-query-parameter + s + `("data unavailable, " + (a (@ (href ,(string-append + "/revision/" s))) + "failed to process revision")))) + (else + (make-invalid-query-parameter + s "unknown job state"))) + (make-invalid-query-parameter + s "unknown commit"))))))) (define (parse-derivation file-name) (if (parallel-via-thread-pool-channel |