 (ns lambdaui.api
-  (:require [org.httpkit.server :refer [with-channel on-close on-receive send!]]
+  (:require [org.httpkit.server :refer [with-channel on-close on-receive send! close]]
             [compojure.core :refer [routes GET POST defroutes context]]
             [ring.util.response :refer [response header]]
             [lambdacd.presentation.unified]

  (when timestamp
    (str timestamp)))

(defn- is-finished [status]
  (contains? #{:success :failure :killed} status))

(defn- step-id-str [step-id]

                  :name      (:name step)
                  :state     (or status :pending)
                  :startTime (to-iso-string (:first-updated-at (:result step)))
                  :endTime   (when (finished? status) (to-iso-string (:most-recent-update-at (:result step))))}
        children (:children step)]
    (if (and children
             (not (empty? children)))
