Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't crash if a memcached bucket is already there.

Change-Id: If13d8c6c6e42cc37acebc3fb21b0b7a4e4b0bb4f
Reviewed-on: http://review.northscale.com/3200
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
commit e2a33d7f2a5bbe1068b064e7b735c6bac899e13e 1 parent 53da2a7
@seanlynch seanlynch authored alk committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/ns_memcached.erl
View
8 src/ns_memcached.erl
@@ -71,7 +71,7 @@ init(Bucket) ->
proc_lib:init_ack({ok, self()}),
Sock = connect(),
StartTime = now(),
- ok = ensure_bucket(Sock, Bucket),
+ ensure_bucket(Sock, Bucket),
wait_for_warmup(Sock),
ns_log:log(?MODULE, 1, "Bucket ~p loaded on node ~p in ~p seconds.",
[Bucket, node(), timer:now_diff(now(), StartTime) div 1000000]),
@@ -357,6 +357,9 @@ ensure_bucket(Sock, Bucket) ->
end.
+-spec ensure_bucket_config(port(), bucket_name(), bucket_type(),
+ {pos_integer(), nonempty_string()}) ->
+ ok | no_return().
ensure_bucket_config(Sock, Bucket, membase, {MaxSize, DBDir}) ->
MaxSizeBin = list_to_binary(integer_to_list(MaxSize)),
DBDirBin = list_to_binary(DBDir),
@@ -396,7 +399,8 @@ ensure_bucket_config(Sock, _Bucket, memcached, _MaxSize) ->
present;
(_, _, CD) ->
CD
- end, not_present).
+ end, not_present),
+ ok.
server(Bucket) ->
Please sign in to comment.
Something went wrong with that request. Please try again.