diff options
-rw-r--r-- | nar-herder/database.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nar-herder/database.scm b/nar-herder/database.scm index 060d2ba..399d527 100644 --- a/nar-herder/database.scm +++ b/nar-herder/database.scm @@ -434,7 +434,7 @@ SELECT contents FROM narinfos WHERE substr(store_path, 12, 32) = :hash" (#(contents) contents) (_ #f)))))) -(define (database-select-recent-changes database after-date) +(define* (database-select-recent-changes database after-date #:key (limit 8192)) (call-with-worker-thread (database-reader-thread-channel database) (lambda (db) @@ -442,11 +442,12 @@ SELECT contents FROM narinfos WHERE substr(store_path, 12, 32) = :hash" (sqlite-prepare db " -SELECT datetime, change, data FROM recent_changes WHERE datetime >= :datetime" +SELECT datetime, change, data FROM recent_changes WHERE datetime >= :datetime LIMIT :limit" #:cache? #t))) (sqlite-bind-arguments statement - #:datetime after-date) + #:datetime after-date + #:limit limit) (let loop ((row (sqlite-step statement)) (result '())) |