 
 ;;;
 
+
 (defn every-hour [ctx]
-  (check-badges (:connection (u/get-db ctx)) (get-in ctx [:config :factory :url])))
+  (let [h (t/hour (t/now))]
+    (when (and (not= h 14) (not= h 15)) ; skip during afternoon hours
+      (check-badges (:connection (u/get-db ctx)) (get-in ctx [:config :factory :url])))))

            (check-badge db-conn factory-url user-badge)
            (jdbc/execute! db-conn ["UPDATE user_badge SET last_checked = UNIX_TIMESTAMP() WHERE id = ?"
                              (:id user-badge)])
            (catch Throwable ex
              (log/error "check-badges failed")
              (log/error (.toString ex)))))

  (:require [clojure.tools.logging :as log]
            [clojure.java.jdbc :as jdbc]
            [clojure.string :as string]
            [clj-time.core :as t]
            [salava.core.util :as u]
            [salava.core.http :as http]))

