From 10678d9510762af6c74e62409c57f83a7b40791a Mon Sep 17 00:00:00 2001 From: Robert Dionne Date: Wed, 15 Dec 2010 21:24:37 -0500 Subject: Use mem3 to get dbname instead of doing pattern matching directly --- apps/couch/src/couch_db.erl | 6 ++++-- apps/couch/src/couch_db_updater.erl | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/couch/src/couch_db.erl b/apps/couch/src/couch_db.erl index a3112e24..0e42980e 100644 --- a/apps/couch/src/couch_db.erl +++ b/apps/couch/src/couch_db.erl @@ -268,8 +268,10 @@ get_db_info(Db) -> ], {ok, InfoList}. -get_design_docs(#db{name = <<"shards/", _:18/binary, DbName/binary>>}) -> - {_, Ref} = spawn_monitor(fun() -> exit(fabric:design_docs(DbName)) end), +get_design_docs(#db{name = <<"shards/", _/binary>> = ShardName}) -> + {_, Ref} = spawn_monitor(fun() -> + exit(fabric:design_docs(mem3:dbname(ShardName))) + end), receive {'DOWN', Ref, _, _, Response} -> Response end; diff --git a/apps/couch/src/couch_db_updater.erl b/apps/couch/src/couch_db_updater.erl index a687440b..ab078caf 100644 --- a/apps/couch/src/couch_db_updater.erl +++ b/apps/couch/src/couch_db_updater.erl @@ -461,8 +461,8 @@ refresh_validate_doc_funs(Db) -> end end, DesignDocs), case Db#db.name of - <<"shards/", _:18/binary, DbName/binary>> -> - fabric:reset_validation_funs(DbName), + <<"shards/", _/binary>> = ShardName -> + fabric:reset_validation_funs(mem3:dbname(ShardName)), Db#db{validate_doc_funs=undefined}; _ -> Db#db{validate_doc_funs=ProcessDocFuns} -- cgit v1.2.3