summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/mumi.in48
1 files changed, 29 insertions, 19 deletions
diff --git a/scripts/mumi.in b/scripts/mumi.in
index 5a91424..a60cf15 100644
--- a/scripts/mumi.in
+++ b/scripts/mumi.in
@@ -56,25 +56,35 @@
"Failed to index `~a'~%" (%config 'mail-dir)))))))
(define update-state!
- (lambda _
- (catch #t
- (lambda ()
- (let ((nums (sort (append-map (lambda (package)
- (soap-invoke* (%config 'debbugs)
- get-bugs
- `((package . ,package))))
- (%config 'packages)) >)))
- (update-mboxes! nums)
- (mu-index)
- (update-bug-database! nums))
- (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!)))))
+ (let ((count 0))
+ (lambda _
+ (catch #t
+ (lambda ()
+ (when (zero? count)
+ (format (current-error-port) "Full refresh!~%"))
+ (let ((nums (sort
+ (append-map (lambda (package)
+ (soap-invoke*
+ (%config 'debbugs)
+ get-bugs
+ `((package . ,package)
+ (archive . ,(if (zero? count)
+ 'both
+ 0)))))
+ (%config 'packages)) >)))
+ (update-mboxes! nums)
+ (mu-index)
+ (update-bug-database! nums)
+ (set! count (modulo (1+ count) 100)))
+ (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)
+ (set! count (modulo (1+ count) 100))
+ (sleep %update-interval)
+ (update-state!))))))
(define %options
;; Specifications of the command-line options