diff options
Diffstat (limited to 'scripts/mumi.in')
-rw-r--r-- | scripts/mumi.in | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/scripts/mumi.in b/scripts/mumi.in index 02847e8..920b279 100644 --- a/scripts/mumi.in +++ b/scripts/mumi.in @@ -50,26 +50,32 @@ ;; Keep indexing the mail directory (define %update-interval 60) -(define* (update-state! #:key loop?) - (catch #t - (lambda () - (index!) - (let ((nums (sort (append-map (lambda (package) - (soap-invoke* (%config 'debbugs) - get-bugs - `((package . ,package)))) - (%config 'packages)) >))) - (update-bug-database! nums)) - (and loop? - (begin - (format (current-error-port) - "Sleeping for ~a seconds." %update-interval) - (sleep %update-interval) - (update-state!)))) - (lambda args - (format (current-error-port) "worker error: ~a~%" args) - (sleep %update-interval) - (update-state!)))) +(define update-state! + (let ((count -1)) + (lambda* (#:key loop?) + (set! count (remainder (1+ count) 10)) + (catch #t + (lambda () + (when (zero? count) + (display "Starting full indexing." (current-error-port)) + (newline (current-error-port))) + (index! #:full? (zero? count)) + (let ((nums (sort (append-map (lambda (package) + (soap-invoke* (%config 'debbugs) + get-bugs + `((package . ,package)))) + (%config 'packages)) >))) + (update-bug-database! nums)) + (and loop? + (begin + (format (current-error-port) + "Sleeping for ~a seconds." %update-interval) + (sleep %update-interval) + (update-state!)))) + (lambda args + (format (current-error-port) "worker error: ~a~%" args) + (sleep %update-interval) + (update-state!)))))) (define %options ;; Specifications of the command-line options |