From c9a2afc79b84bbf68531375cd707d82f15b83d33 Mon Sep 17 00:00:00 2001 From: Aaron Mueller Date: Sat, 18 Jan 2014 00:01:50 +0100 Subject: [PATCH] Some structural work --- project.clj | 3 ++- src/ldview/handler.clj | 3 +-- src/ldview/repl.clj | 6 +++--- src/ldview/tasks/runner.clj | 7 +++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/project.clj b/project.clj index b6b9e3d..3f225b8 100644 --- a/project.clj +++ b/project.clj @@ -18,7 +18,8 @@ [enlive "1.1.1"] [me.raynes/fs "1.4.5"]] - :plugins [[lein-ring "0.8.7"]] + :plugins [[lein-ring "0.8.7"] + [lein-autoreload "0.1.0"]] :ring {:handler ldview.handler/war-handler :init ldview.handler/init :destroy ldview.handler/destroy} diff --git a/src/ldview/handler.clj b/src/ldview/handler.clj index d11b195..137c414 100644 --- a/src/ldview/handler.clj +++ b/src/ldview/handler.clj @@ -30,8 +30,7 @@ [:shared-appender-config :rotor] {:path "ldview.log" :max-size (* 512 1024) :backlog 10}) - ;(if-not (schema/initialized?) (schema/create-tables)) - + (if-not (schema/initialized?) (schema/create-tables)) (timbre/info "ldview started successfully")) (defn destroy diff --git a/src/ldview/repl.clj b/src/ldview/repl.clj index b95e227..9fedf6c 100644 --- a/src/ldview/repl.clj +++ b/src/ldview/repl.clj @@ -24,10 +24,10 @@ (serve (get-handler) {:port port :init init - :auto-reload? true :destroy destroy - :join? true})) - (println (str "You can view the site at http://localhost:" port)))) + :auto-reload? true + :open-browser? false + :join? false})))) (defn stop-server [] (.stop @server) diff --git a/src/ldview/tasks/runner.clj b/src/ldview/tasks/runner.clj index 555057d..8398801 100644 --- a/src/ldview/tasks/runner.clj +++ b/src/ldview/tasks/runner.clj @@ -32,11 +32,10 @@ (if-not (entry/exists? ld-uid) (save-entry (scrape/entry-details ld-uid))))))) -(defn prepare [] +; TODO: Whatch out, the competition is set in the scrape .... refactor this ... +(defn load-competition [id title] (cleanup) (schema/create-tables) - (competition/create! 27 "10 Seconds")) ; FIXME: Make it dynamic - -(defn start [] + (competition/create! id title) (fetch-all-content))