aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/model/git-repository.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-data-service/model/git-repository.scm')
-rw-r--r--guix-data-service/model/git-repository.scm24
1 files changed, 16 insertions, 8 deletions
diff --git a/guix-data-service/model/git-repository.scm b/guix-data-service/model/git-repository.scm
index 102dc43..feae290 100644
--- a/guix-data-service/model/git-repository.scm
+++ b/guix-data-service/model/git-repository.scm
@@ -35,28 +35,36 @@
(define (all-git-repositories conn)
(map
(match-lambda
- ((id label url cgit-base-url)
+ ((id label url cgit-base-url poll-interval)
(list (string->number id)
label
url
- cgit-base-url)))
+ cgit-base-url
+ (and=> poll-interval string->number))))
(exec-query
conn
- (string-append
- "SELECT id, label, url, cgit_url_base FROM git_repositories ORDER BY id ASC"))))
+ "
+SELECT id, label, url, cgit_url_base, poll_interval
+FROM git_repositories ORDER BY id ASC")))
(define (select-git-repository conn id)
(match (exec-query
conn
- "SELECT label, url, cgit_url_base, fetch_with_authentication FROM git_repositories WHERE id = $1"
- (list id))
+ "
+SELECT label, url, cgit_url_base, fetch_with_authentication, poll_interval
+FROM git_repositories
+WHERE id = $1"
+ (list (if (number? id)
+ (number->string id)
+ id)))
(()
#f)
- (((label url cgit_url_base fetch_with_authentication))
+ (((label url cgit_url_base fetch_with_authentication poll-interval))
(list label
url
cgit_url_base
- (string=? fetch_with_authentication "t")))))
+ (string=? fetch_with_authentication "t")
+ (and=> poll-interval string->number)))))
(define (git-repository-query-substitutes? conn id)
(match (exec-query