Skip to content

Commit

Permalink
Upgraded clojure 1.2.1 -> 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jsyrjala committed Mar 30, 2012
1 parent 85d2225 commit 5988770
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions project.clj
Expand Up @@ -2,7 +2,7 @@
:description "RuuviTracker server"
:dependencies
[
[org.clojure/clojure "1.2.1"]
[org.clojure/clojure "1.3.0"]
[compojure "1.0.1"]
[ring-json-params "0.1.3"]
[clj-json "0.5.0"]
Expand All @@ -25,7 +25,7 @@
[org.apache.tomcat/tomcat-jdbc "7.0.25"]
[org.clojure/java.jdbc "0.1.3"]
[korma "0.3.0-beta9" :exclusions [log4j/log4j] ]
[lobos "0.8.0"]
[lobos "1.0.0-SNAPSHOT"]
]
:dev-dependencies
[
Expand Down
6 changes: 3 additions & 3 deletions src/ruuvi_server/heroku/config.clj
Expand Up @@ -10,7 +10,7 @@
(info "Environment DATABASE_URL =" (System/getenv "DATABASE_URL"))
(info "Environment PORT =" (System/getenv "PORT"))

(def *database-config*
(def database-config
;; Heroku DATABASE_URL looks like this:
;; postgres://username:password@some.host.at.amazonaws.com/databasename
(let [uri (URI. (System/getenv "DATABASE_URL"))
Expand All @@ -22,7 +22,7 @@
:subname (str "//" (.getHost uri) (.getPath uri))
}))

(def *server-port* (Integer/parseInt (System/getenv "PORT")))
(defdb db (postgres *database-config*))
(def server-port (Integer/parseInt (System/getenv "PORT")))
(defdb db (postgres database-config))
(init-entities)
)
2 changes: 1 addition & 1 deletion src/ruuvi_server/heroku/migration.clj
Expand Up @@ -6,6 +6,6 @@

(defn -main [direction]
(init-config)
(do-migration (keyword direction) *database-config*)
(do-migration (keyword direction) database-config)
)

4 changes: 2 additions & 2 deletions src/ruuvi_server/heroku/starter.clj
Expand Up @@ -6,6 +6,6 @@
;; heroku webapp starter
(defn -main []
(init-config)
(start-prod {:server-port *server-port*
:database-config *database-config*})
(start-prod {:server-port server-port
:database-config database-config})
)
6 changes: 3 additions & 3 deletions src/ruuvi_server/standalone/config.clj
Expand Up @@ -7,13 +7,13 @@

(defn init-config []
(in-ns 'ruuvi-server.standalone.config)
(def *database-config*
(def database-config
{:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:user "ruuvi"
:password "ruuvi"
:subname "//localhost/ruuvi_server"})
(def *server-port* 8080)
(def server-port 8080)

(defn- db-with-connection-pool [spec]
(let [engine-conf (postgres spec)]
Expand All @@ -24,7 +24,7 @@
)

(def max-threads 80)
(defdb db (postgres *database-config*))
(defdb db (postgres database-config))
;; setup korma to use connection pool of my choosing
;;(db-with-connection-pool *database-config*)
(init-entities)
Expand Down
2 changes: 1 addition & 1 deletion src/ruuvi_server/standalone/migration.clj
Expand Up @@ -7,5 +7,5 @@

(defn -main [direction]
(init-config)
(do-migration (keyword direction) *database-config*)
(do-migration (keyword direction) database-config)
)
10 changes: 6 additions & 4 deletions src/ruuvi_server/standalone/starter.clj
Expand Up @@ -11,9 +11,11 @@
;; should only execute start-dev if some environment variable is set
(init-config)
(if (= arg "prod")
(start-prod {:server-port *server-port*
:database-config *database-config*})
(start-dev {:server-port *server-port*
:database-config *database-config*})
(start-prod {:server-port server-port
:database-config database-config
:max-threads max-threads})
(start-dev {:server-port server-port
:database-config database-config
:max-threads max-threads})
)
)

0 comments on commit 5988770

Please sign in to comment.