You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/10 21:05:15 UTC

[15/50] couch commit: updated refs/remotes/origin/import to 09c6556

Notify the ddoc cache when design docs change


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

Branch: refs/remotes/origin/import
Commit: 207708a09adf9162f2fe133a1662a3b90b222df7
Parents: 651e26f
Author: Paul J. Davis <pa...@gmail.com>
Authored: Wed Jan 23 15:16:29 2013 -0600
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Feb 4 17:03:24 2014 -0600

----------------------------------------------------------------------
 src/couch_db_updater.erl | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/207708a0/src/couch_db_updater.erl
----------------------------------------------------------------------
diff --git a/src/couch_db_updater.erl b/src/couch_db_updater.erl
index 1be3e3a..e1dc7c3 100644
--- a/src/couch_db_updater.erl
+++ b/src/couch_db_updater.erl
@@ -732,11 +732,12 @@ update_docs_int(Db, DocsList, NonRepDocs, MergeConflicts, FullCommit) ->
 
     % Check if we just updated any design documents, and update the validation
     % funs if we did.
-    Db4 = case UpdatedDDocIds of
-    [] ->
-        Db3;
-    _ ->
-        refresh_validate_doc_funs(Db3)
+    Db4 = case length(UpdatedDDocIds) > 0 of
+        true ->
+            ddoc_cache:evict(Db3#db.name, UpdatedDDocIds),
+            refresh_validate_doc_funs(Db3);
+        false ->
+            Db3
     end,
 
     {ok, commit_data(Db4, not FullCommit), UpdatedDDocIds}.