Revert "scripts: update-state!: Do a full refresh every 100 times."
authorRicardo Wurmus <rekado@elephly.net>
Tue, 7 Apr 2020 14:11:50 +0000 (16:11 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 7 Apr 2020 14:11:50 +0000 (16:11 +0200)
This reverts commit 5c21d1deb3e534aedaaae4802423db0a5df041b0.

scripts/mumi.in

index 2b1f70f1eceae34b2f03f2baf5a4ab0138990e45..02d8af466e1fc11fe889c3a979762343d6761577 100644 (file)
                   "Failed to index `~a'~%" (%config 'mail-dir)))))))
 
 (define 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!))))))
+  (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!)))))
 
 (define %options
   ;; Specifications of the command-line options