summaryrefslogtreecommitdiff
path: root/apps/couch
diff options
context:
space:
mode:
Diffstat (limited to 'apps/couch')
-rw-r--r--apps/couch/src/couch_view_group.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/couch/src/couch_view_group.erl b/apps/couch/src/couch_view_group.erl
index 730db185..b0e67db5 100644
--- a/apps/couch/src/couch_view_group.erl
+++ b/apps/couch/src/couch_view_group.erl
@@ -441,7 +441,12 @@ set_view_sig(#group{
open_db_group(DbName, GroupId) ->
{Pid, Ref} = spawn_monitor(fun() ->
- exit(fabric:open_doc(mem3:dbname(DbName), GroupId, []))
+ exit(try
+ fabric:open_doc(mem3:dbname(DbName), GroupId, [])
+ catch error:database_does_not_exist ->
+ {ok, Db} = couch_db:open(DbName, []),
+ couch_db:open_doc(Db, GroupId)
+ end)
end),
receive {'DOWN', Ref, process, Pid, {ok, Doc}} ->
{ok, design_doc_to_view_group(Doc)};