Fix bug where inactive branches were counted as failures
[candle] / src / main / server.lisp
index bdf8d77c4e3c31fc27f427581cb64717bf4beb7c..338516bed5eae32303ce221773db87296cb09b63 100644 (file)
        :while active
        :do
        (sb-thread:with-mutex (mutex)
-        (sb-thread:condition-wait waitq mutex)))
-      (lame-db:save-known-dbs data-dir))
+        (sb-thread:condition-wait waitq mutex)
+        (lame-db:save-known-dbs data-dir))))
      :name "Save Thread")))
   (sb-thread:make-thread
    (lambda ()
     (loop
-     (sleep (* 1 60))
+     (sleep (* 5 60))
      (sb-thread:with-mutex (mutex)
       (sb-thread:condition-broadcast waitq))))
    :name "Save Thread Trigger")
   ((project (find-project-by-name-or-die project-name)))
   (length
    (remove-if-not
-    (lambda (branch) (eql :failed (job-status (branch-job branch))))
+    (lambda (branch) (and (branch-in-git branch) (eql :failed (job-status (branch-job branch)))))
     (if project (find-branch-by-project project) *all-branch*)))))