Skip to content

Commit

Permalink
get rid of extra bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
bondiano committed Oct 10, 2023
1 parent dda5d1f commit 4ef3b7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/ligretto_bot_clj/bot/strategies.clj
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@

(defmethod make-turn :easy
[ctx]
;; todo: move out from make-turns
(go
(<! (turn-timeout ctx))
(easy-turn-action ctx)))
6 changes: 2 additions & 4 deletions src/ligretto_bot_clj/web/app.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
;; { game-id { bot-id { bot } } }
(defmethod ig/init-key :web/db
[_ {:keys [init-value] :or {init-value {}}}]
;; todo: make protocol for dao and use it here
(let [db (atom init-value)]
(run-clear-db-worker db)
db))
Expand All @@ -45,9 +46,6 @@
(log/error (ex-message e))))))
(reset! db {}))

(def ^:dynamic *ctx* nil)

(defmethod ig/init-key :web/app
[_ {:keys [db]}]
(binding [*ctx* {:db db}]
(wrap-base router *ctx*)))
(wrap-base router {:db db}))

0 comments on commit 4ef3b7b

Please sign in to comment.