 (comment
 
   (initialize server-state "opt/server-config-1.edn")
+
+  (let [{{:keys [follow track credentials]} :app} @server-state]
+    (start-filter-stream follow track (partial stream-handler server-state) credentials))
+
+  (stop-stream)
 
   (def g (start-stream server-state))
 

                 (io/resource "public/index.html"))))


(defn -main [& args]
  (initialize server-state (first args))
  (timbre/set-config! [:appenders :spit :enabled?] true)
  (timbre/set-config! [:shared-appender-config :spit-filename] (:logfile @server-state))
  (info "Starting twitter collector...")

  (info @server-state)
  (when (:http-server? @server-state)
    (run-server (site #'all-routes) {:port (:port @server-state) :join? false}))
  (let [{{:keys [follow track credentials]} :app} @server-state]
    (start-filter-stream follow track (partial stream-handler server-state) credentials))
  (when (:backup? @server-state)
    (start-executor (:backup-folder @server-state))))

