File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 42
42
(tap> " test" )
43
43
44
44
(tap> @system))
45
+
45
46
(defn shutdown-hook []
46
47
(.addShutdownHook (Runtime/getRuntime )
47
48
(Thread. ^Runnable
Original file line number Diff line number Diff line change 11
11
[db]
12
12
(log/info " Clearing DB" )
13
13
(doseq [[game-id game] @db]
14
- (if ( empty? game)
15
- (swap! db dissoc game-id )
16
- ( doseq [ bot ( vals game)]
17
- (when ( = @( :status bot) :shutdown )
18
- ( log/info " Removing bot " ( :bot-id bot) " from game" game-id )
19
- (swap! db dissoc game-id ( keyword ( :bot-id bot)))) ))))
14
+ (doseq [bot ( vals game)]
15
+ (when ( = @( :status bot) :shutdown )
16
+ ( log/info " Removing bot" ( :bot-id bot) " from game" game-id)
17
+ (swap! db dissoc game-id ( keyword ( :bot-id bot)))) )
18
+ ( when ( empty? game)
19
+ (swap! db dissoc game-id))))
20
20
21
21
(defn run-clear-db-worker
22
22
" Runs worker to clear stopped bots from DB
Original file line number Diff line number Diff line change 90
90
bot (get-in @db [game-id* bot-id*])]
91
91
(when (not (nil? bot))
92
92
(stop-bot bot)
93
- (swap! db update-in [game-id] dissoc bot-id*)
93
+ (swap! db update-in [game-id* ] dissoc bot-id*)
94
94
(->bot bot)))))
95
95
96
96
(defn remove-game
You can’t perform that action at this time.
0 commit comments