 (require '[clojure.tools.logging   :as log])
 
 (def verbose true)
-(def port 4000)
+(def port 3000)
 
 (defn slurp-
     [filename]

        (log/info "before"     before)
        (log/info "after"      after)
        (log/info "operation"  operation)
        ))

        

(defn http-request-handler
    "Handler that is called by Ring for all requests received from user(s)."

    (let [body (read-request-body request)]
        (if body
            (json/read-str body :key-fn clojure.core/keyword))))

(defn clone-or-fetch-bare-repo
    [repository-url]
    (log/info "Cloning or fetching bare repository" repository-url)
    )

(def actions (java.util.concurrent.LinkedBlockingQueue.))

(defn action-consumer
    []
    (log/info "Starting actions consumer")
    (future                                    ; start consumer in its own thread
        (while true
            (when-let [action (.take actions)] ; blocking operation
                (log/info "Got action for repository" action)
                (clone-or-fetch-bare-repo action)
            ))))

(defn new-action
    [action]
    (.put actions action))

(def empty-SHA "0000000000000000000000000000000000000000")

