taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 131 forks source link

The :db option for spec-opts is not working in dev branch #114

Closed bo-chen closed 9 years ago

bo-chen commented 9 years ago

Repro:

(car/wcar {:pool {} :spec {:db 0}} (car/set "thisdb" 0))
(car/wcar {:pool {} :spec {:conn-setup-fn (fn [_] (car/select "1"))}} (car/set "thisdb" 1))
(car/wcar {:pool {} :spec {:db 1}} (car/get "thisdb")) 
; => expected 1, but returns 0

Cause: connections.clj line 70: (when (and db (not (zero? db)) db)) The parens nesting is off so this always returns nil.

ptaoussanis commented 9 years ago

Hi Bo, thanks a lot for the catch - fixed on the dev branch and SNAPSHOT. Cheers! :-)