          (let [qname (misc/initialize-rabbitmq-structures ch "update_directory" "nextbot" fs)]
            (logging/info "starting consumer for" qname)
            (lb/qos ch 1)
-           (lcons/subscribe ch qname (mqhelper/make-handler (partial simple-update_directory fs)))))))))
+           (lcons/subscribe ch qname
+                            (mqhelper/make-handler (partial simple-update_directory fs es-index)))))))))
 
 
 (defn esconnect-run-section

(ns brainbot.nozzle.esconnect
  (:require [clojure.tools.logging :as logging])
  (:require [langohr.core :as rmq]
            [langohr.consumers :as lcons]



(defn simple-update_directory
  [fs es-index {:keys [directory entries] :as body} {publish :publish}]
  (println "update-directory" body)

  (doseq [e (filter #(= (get-in % [:stat :type]) "directory") entries)]
    (let [id (string/join "/" [directory (:relpath e)])]
      (println "put" e)
      (esd/put es-index "dir"
               id
               {:mtime (get-in e [:stat :mtime])
                :parent directory}))))



(defn build-handle-connection
