couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [22/50] [abbrv] couchdb-mango git commit: Attempt to retrieve indexes from cache
Date Tue, 03 Feb 2015 15:13:29 GMT
Attempt to retrieve indexes from cache

BugzID: 42707


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/c61576c3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/c61576c3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/c61576c3

Branch: refs/heads/master
Commit: c61576c3cb44ee43a68764dbde7837edce821be7
Parents: 6f661f1
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Thu Dec 11 14:32:48 2014 -0500
Committer: Adam Kocoloski <adam@cloudant.com>
Committed: Thu Dec 11 16:19:44 2014 -0500

----------------------------------------------------------------------
 src/mango_idx.erl | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/c61576c3/src/mango_idx.erl
----------------------------------------------------------------------
diff --git a/src/mango_idx.erl b/src/mango_idx.erl
index 4a3cf83..c1bbe4c 100644
--- a/src/mango_idx.erl
+++ b/src/mango_idx.erl
@@ -7,6 +7,7 @@
 
 -export([
     list/1,
+    recover/1,
 
     new/2,
     validate/1,
@@ -36,6 +37,10 @@
 
 
 list(Db) ->
+    {ok, Indexes} = ddoc_cache:open(Db, ?MODULE),
+    Indexes.
+
+recover(Db) ->
     {ok, DDocs0} = mango_util:open_ddocs(Db),
     Pred = fun({Props}) ->
         case proplists:get_value(<<"language">>, Props) of
@@ -45,9 +50,9 @@ list(Db) ->
     end,
     DDocs = lists:filter(Pred, DDocs0),
     Special = special(Db),
-    Special ++ lists:flatmap(fun(Doc) ->
+    {ok, Special ++ lists:flatmap(fun(Doc) ->
         from_ddoc(Db, Doc)
-    end, DDocs).
+    end, DDocs)}.
 
 
 new(Db, Opts) ->


Mime
View raw message