Browse files

Move erlmc:start to start function, not init

Because Erlmc does its own pool management we just want to call
erlmc:start once. init is the wrong place to call this because
it is called once for each process in the worker pool.
  • Loading branch information...
1 parent e5aa7db commit f79fe31d7d71592bae7ea92bb1c7c7546a3da889 Evan Miller committed May 28, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/cache_adapters/boss_cache_adapter_memcached_bin.erl
View
10 src/cache_adapters/boss_cache_adapter_memcached_bin.erl
@@ -7,15 +7,15 @@
start() ->
start([]).
-start(_Options) ->
- {ok, undefined}.
+start(Options) ->
+ CacheServers = proplists:get_value(cache_servers, Options, [{"localhost", 11211, 1}]),
+ ok = erlmc:start(CacheServers),
+ ok.
stop(_Conn) ->
erlmc:quit().
-init(Options) ->
- CacheServers = proplists:get_value(cache_servers, Options, [{"localhost", 11211, 1}]),
- ok = erlmc:start(CacheServers),
+init(_Options) ->
{ok, undefined}.
get(_Conn, Prefix, Key) ->

0 comments on commit f79fe31

Please sign in to comment.