You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2026/03/24 22:46:17 UTC
(couchdb) 11/13: remove open_or_create_index/2
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch nouveau-update-bundle
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f15b5ff63fbdda8ea3482b67010a430240d3043f
Author: Robert Newson <rn...@apache.org>
AuthorDate: Sat Mar 21 23:32:59 2026 +0000
remove open_or_create_index/2
---
src/nouveau/src/nouveau_index_updater.erl | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/nouveau/src/nouveau_index_updater.erl b/src/nouveau/src/nouveau_index_updater.erl
index 763e12d03..62fcb55d3 100644
--- a/src/nouveau/src/nouveau_index_updater.erl
+++ b/src/nouveau/src/nouveau_index_updater.erl
@@ -50,10 +50,11 @@
update(#index{} = Index) ->
{ok, Db} = couch_db:open_int(Index#index.dbname, []),
try
- case open_or_create_index(Db, Index) of
+ case open_or_create_index(Index) of
{error, Reason} ->
exit({error, Reason});
{ok, #{} = Info} ->
+ nouveau_util:maybe_create_local_purge_doc(Db, Index),
#{<<"update_seq">> := IndexUpdateSeq, <<"purge_seq">> := IndexPurgeSeq} = Info,
ChangesSince = couch_db:count_changes_since(Db, IndexUpdateSeq),
PurgesSince = couch_db:get_purge_seq(Db) - IndexPurgeSeq,
@@ -214,15 +215,6 @@ open_or_create_index(#index{} = Index) ->
{error, Reason}
end.
-open_or_create_index(Db, #index{} = Index) ->
- case open_or_create_index(Index) of
- {ok, #{} = Info} ->
- nouveau_util:maybe_create_local_purge_doc(Db, Index),
- {ok, Info};
- Else ->
- Else
- end.
-
get_db_info(#index{} = Index) ->
{ok, Db} = couch_db:open_int(Index#index.dbname, []),
try