This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch nouveau-ken
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit f4fb9810a88891607e8e9e4b13fb50cb6b2f459f
Author: Robert Newson <[email protected]>
AuthorDate: Thu Mar 26 08:16:35 2026 +0000

    Revert "remove unused function"
    
    This reverts commit 278c5e3ab1fe67b4d6845831e13f18f05a0df91d.
---
 src/nouveau/src/nouveau_index_updater.erl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/nouveau/src/nouveau_index_updater.erl 
b/src/nouveau/src/nouveau_index_updater.erl
index 5b58d1e4c..5cff1222e 100644
--- a/src/nouveau/src/nouveau_index_updater.erl
+++ b/src/nouveau/src/nouveau_index_updater.erl
@@ -18,7 +18,7 @@
 -include("nouveau.hrl").
 
 %% public api
--export([get_db_info/1]).
+-export([outdated/1, get_db_info/1]).
 
 %% callbacks
 -export([update/1]).
@@ -47,6 +47,16 @@
     batch
 }).
 
+outdated(#index{} = Index) ->
+    case open_or_create_index(Index) of
+        {ok, #{} = Info} ->
+            #{<<"update_seq">> := IndexUpdateSeq, <<"purge_seq">> := 
IndexPurgeSeq} = Info,
+            {DbUpdateSeq, DbPurgeSeq} = get_db_info(Index),
+            DbUpdateSeq > IndexUpdateSeq orelse DbPurgeSeq > IndexPurgeSeq;
+        {error, Reason} ->
+            {error, Reason}
+    end.
+
 update(#index{} = Index) ->
     {ok, Db} = couch_db:open_int(Index#index.dbname, []),
     try

Reply via email to