Created
December 27, 2011 00:16
-
-
Save anonymous/1522334 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn with-mc* | |
"Manages the memcache connection" | |
[mchosts func] | |
(let [^MemcachedClient con (get-connection mchosts)] | |
(debug "set up new connection") | |
(. Thread (sleep 1)) ; fix to workaround bug #... | |
(binding [*db* (assoc *db* :connection con :level 0)] | |
(func))(.shutdown con 5 TimeUnit/SECONDS)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment