diff options
author | Robert Dionne <bob@cloudant.com> | 2010-12-15 21:24:37 -0500 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2010-12-20 23:30:43 -0500 |
commit | 10678d9510762af6c74e62409c57f83a7b40791a (patch) | |
tree | 50748764e4ccec3b6fe9587c0d3e9fb75dd64193 /apps/couch/src | |
parent | f91eabafccb3a1ebae9ac770d6ad3d64efcf47dc (diff) |
Use mem3 to get dbname instead of doing pattern matching directly
Diffstat (limited to 'apps/couch/src')
-rw-r--r-- | apps/couch/src/couch_db.erl | 6 | ||||
-rw-r--r-- | 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} |