~pepe/neil

5c297dd929251a6b44200e0177e6006f2faf2644 — Josef Pospíšil 8 months ago 7b64f08 master
Fix stat details
2 files changed, 6 insertions(+), 6 deletions(-)

M neil/http/stats/init.janet
M neil/http/stats/utils.janet
M neil/http/stats/init.janet => neil/http/stats/init.janet +4 -4
@@ 22,9 22,9 @@

(defn interval [{:params {:interval i :project project :state state}}]
  (define-store)
  (def c @[])
  (def [projects clients]
    (retrieve store [:clients (collect c) (in-all :projects) (merged)]))
  (def clients @[])
  (def projects
    (retrieve store [:clients (collect clients) (in-all :projects) (merged)]))
  (def epochs
    (case i
      "today" [(:epoch (today))]


@@ 42,7 42,7 @@
      2 |(and
           (>= ($ :start) (first epochs))
           (<= ($ :end) (last epochs)))))
  (loop-interval-tasks redseqcond ;epochs))
  (loop-interval-tasks redseqcond (clients 0) projects ;epochs))

(defn filter [{:body body}]
  (define-store)

M neil/http/stats/utils.janet => neil/http/stats/utils.janet +2 -2
@@ 23,9 23,9 @@
                     :intervals-count cnt
                     :one-go (and (= (length wi) 1) (= st "completed"))))))

(defmacro loop-interval-tasks [redseqcond & epochs]
(defmacro loop-interval-tasks [redseqcond clients projects & epochs]
  ~(loop-tasks (,tracked-tasks store project state ,;epochs)
               ,redseqcond clients projects))
               ,redseqcond ,clients ,projects))

(defmacro loop-tasks-csv [coll redseqcond]
  ~(loop [{:uuid i :name n