 (ns dakait.files
   (:use compojure.core
         dakait.config
+        [clojure.core.async :only (thread)]
         [dakait.util :only (join-path)]
         [clojure.tools.logging :only (info error)])
   (:require 

      (reset! ssh-agent agent)))
  @ssh-agent)

(defn- session []
  "Get the currently active session, if one doesn't exist, create a new one and make sure the
  session is connected"

                                           :username user
                                           :strict-host-key-checking :no})]
      (info "New session created with param: " host user port)
      (reset! ssh-session session)
      (ssh/connect session)))
  ;; seems to me the ssh/connected? seems to return true and then the channel creation fails with "Session not connected"
  ;; Explictely call connect every time the session is requested.
  (reset-session-invalidate)
  @ssh-session)

(defn all-files [path]
