                              (and cause
                                   (str " caused by: ") (.getMessage cause)))]
             (println "Had some trouble in the scrape loop:" err-msg))
-          (Thread/sleep (* 60 1000)))))))
+          (Thread/sleep scrape-period))))))

               (when-not (empty? new)
                 (update-states! all)
                 (reset! backup-imgs all))
               (Thread/sleep (* 5 60 1000))
               (recur all)))
        (catch Throwable err
          (let [cause (.getCause err)


(defn scrape-loop!
  []
  (let [backup-imgs (atom (get-cached-images))
        scrape-period (* 15 60 1000)] ; 15 minutes
    (while true
      (try (loop [imgs @backup-imgs]
             (let [{:keys [new old all]} (fetch-tick imgs)]
