diff --git a/src/pricebot/core.clj b/src/pricebot/core.clj index 2950173..dc82864 100644 --- a/src/pricebot/core.clj +++ b/src/pricebot/core.clj @@ -192,18 +192,19 @@ bebot-auth-token-file bebot-channel-id notify-user]} (get-args required-keys args) - logger (bebot-log/make-logger bebot-url - (-> bebot-auth-token-file slurp str/trim-newline) - bebot-channel-id - notify-user) - checks (create-checks logger) - bot (reify-bot exchange-host - (-> currency str/lower-case keyword) - checks) + logger (bebot-log/make-logger bebot-url + (-> bebot-auth-token-file slurp str/trim-newline) + bebot-channel-id + notify-user) + checks (create-checks logger) + bot (reify-bot exchange-host + (-> currency str/lower-case keyword) + checks) shutdown (chan)] (.addShutdownHook (Runtime/getRuntime) (Thread. (fn [] (println "Stopping pricebot...") + (log/notify! logger (str "Shutting down pricebot for " (name currency) ".")) (stop! bot) (>!! shutdown true)))) (log/notify! logger (str "Hi! I'm going to start watching the price of " (name currency) " for you."))