This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push:
new 95fe2013a Reset docs_size in quickjs scanner
95fe2013a is described below
commit 95fe2013a1205c4d6ae612be925153415e853b04
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Thu Nov 13 14:20:46 2025 -0500
Reset docs_size in quickjs scanner
When we switch dbs make sure to reset db specific stuff. It's probably
overkill
to do it in multiple places, but it doesn't hurt either.
---
src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
b/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
index 91385010c..3e4a545a7 100644
--- a/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
+++ b/src/couch_quickjs/src/couch_quickjs_scanner_plugin.erl
@@ -150,7 +150,7 @@ db_opened(#st{} = St, Db) ->
#st{max_docs = MaxDocs, max_step = MaxStep} = St,
{ok, DocTotal} = couch_db:get_doc_count(Db),
Step = min(MaxStep, max(1, DocTotal div MaxDocs)),
- {0, [], St#st{doc_cnt = 0, doc_step = Step, docs = []}}.
+ {0, [], St#st{doc_cnt = 0, docs_size = 0, doc_step = Step, docs = []}}.
doc_id(#st{} = St, <<?DESIGN_DOC_PREFIX, _/binary>>, _Db) ->
{skip, St};
@@ -436,6 +436,7 @@ reset_per_db_state(#st{qjs_proc = QjsProc, sm_proc =
SmProc} = St) ->
St#st{
ddocs = #{},
docs = [],
+ docs_size = 0,
qjs_proc = undefined,
sm_proc = undefined,
ddoc_cnt = 0