 
 (defn- satisfy*
   [{:keys [satisfied todo done]} new-deps]
-  ;(log/info (format "new-deps: %s" new-deps))
   (let [satisfied (set/union satisfied new-deps)
-        ;_ (log/info (format "satisfied: %s" satisfied))
         execute-tasks (fn [[final-done final-todo] [key deps task]]
-                        ;(log/info (format "Satisfied? = %s --- sat: %s deps: %s" (set/superset? satisfied deps) satisfied deps))
                         (if (set/superset? satisfied deps)
                           (do
-                            ;(log/info "Satisfying deps: " deps)
-                            (task)
+                            (log/info "Running dep handler: " key)
+                            (try
+                              (task)
+                              (catch Exception e
+                                (log/error (format "Exception in dependency handler: %s\n%s"
+                                                   key
+                                                   (with-out-str (.printStackTrace e))))))
                             [(conj final-done [key deps task]) final-todo])
                           [final-done (conj final-todo [key deps task])]))
         [t-done t-todo] (reduce execute-tasks [done []] todo)]
+    (log/info "deps-satisfied: " satisfied)
     {:satisfied satisfied
      :done t-done
      :todo t-todo}))


(defn wait-until-deps-satisfied
  "Makes the current thread sleep until specified deps have been satisfied.
  Thread enters a sleep cycle sleeping for wait-time ms before each dep check.
  If timeout is a positive value throws timeout exception if deps haven't been
  satisfied by timeout ms. Default wait-time is 100ms and default timeout is
  10000 ms"
  ([deps] (wait-until-deps-satisfied deps 10000 100))
  ([deps timeout] (wait-until-deps-satisfied deps timeout 100))
  ([deps timeout wait-time]
     (if (<= timeout 0)
       (while (not (deps-satisfied? deps))
         (Thread/sleep wait-time))
       (loop [sleep-time 0]
         (when (> sleep-time timeout)
           (throw (Exception. (str "The following deps took too long to be satisfied: " deps))))
         (when-not (deps-satisfied? deps)
           (Thread/sleep wait-time)
           (recur (+ sleep-time wait-time)))))))

  "Specifies that a list of dependencies have been satisfied. Uses an agent so
  it's safe to call this from within a transaction."
  [& deps]
  (log/info (format "satisfying deps: %s" deps))
  (send-off dep-state* satisfy* (set deps)))

(defn reset-deps
