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/df395bf8 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/df395bf8 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/df395bf8 Branch: refs/heads/import Commit: df395bf8b1658f3cb019f7ea2491fe89e3a9619f Parents: 1e5ed19 Author: Paul J. Davis <[email protected]> Authored: Wed Jan 23 15:16:29 2013 -0600 Committer: Paul J. Davis <[email protected]> Committed: Fri Jan 17 16:44:30 2014 -0800 ---------------------------------------------------------------------- src/couch_db_updater.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/df395bf8/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}.
