You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2023/07/08 13:29:46 UTC
[couchdb] 01/03: refactor: simplify detecting updated ddocs
This is an automated email from the ASF dual-hosted git repository.
jan pushed a commit to branch rebase/access-2023
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 8fb85db1c8a635675c3b6ac499dcd55b05883369
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Sat Jul 8 15:28:17 2023 +0200
refactor: simplify detecting updated ddocs
---
src/couch/src/couch_db_updater.erl | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl
index 03c277ac3..c30ec3e5a 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -761,7 +761,7 @@ update_docs_int(Db, DocsList, LocalDocs, ReplicatedChanges) ->
% the trees, the attachments are already written to disk)
{ok, IndexFDIs} = flush_trees(Db, NewFullDocInfos, []),
Pairs = pair_write_info(OldDocLookups, IndexFDIs),
- LocalDocs1 = apply_local_docs_access(Db, LocalDocs), % TODO: local docs acess needs validating
+ LocalDocs1 = apply_local_docs_access(Db, LocalDocs), % TODO: local docs access needs validating
LocalDocs2 = update_local_doc_revs(LocalDocs1),
{ok, Db1} = couch_db_engine:write_doc_infos(Db, Pairs, LocalDocs2),
@@ -779,14 +779,14 @@ update_docs_int(Db, DocsList, LocalDocs, ReplicatedChanges) ->
% Check if we just updated any non-access design documents,
% and update the validation funs if we did.
- NonAccessIds = [Id || [{_Client, #doc{id = Id, access = []}} | _] <- DocsList],
- UpdatedDDocIds = lists:flatmap(
- fun
- (<<"_design/", _/binary>> = Id) -> [Id];
- (_) -> []
- end,
- NonAccessIds
- ),
+ UpdatedDDocIds = [Id || [{_Client, #doc{id = <<"_design/", _/binary>> = Id, access = []}} | _] <- DocsList],
+ % UpdatedDDocIds = lists:flatmap(
+ % fun
+ % (<<"_design/", _/binary>> = Id) -> [Id];
+ % (_) -> []
+ % end,
+ % NonAccessIds
+ % ),
{ok, commit_data(Db1), UpdatedDDocIds}.