Skip to content

don't debounce if it's already scheduled sooner - #16

Merged
ianmacartney merged 1 commit into
mainfrom
ian/debounce-ping-noop
Aug 21, 2026
Merged

ianmacartney merged 1 commit into
mainfrom
ian/debounce-ping-noop

Conversation

@ianmacartney

@ianmacartney ianmacartney commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Currently, if you ping a BatchWorker that is going to execute in 3s, but you pass debounceMs of 10s, then it'll re-schedule the worker to run in 10s instead.
We should instead bias towards running sooner, so timeoutMs is respected when a worker returns that

@ianmacartney
ianmacartney requested a review from reeceyang August 20, 2026 20:30

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pkg-pr-new

pkg-pr-new Bot commented Aug 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/batch-worker@16

commit: bb19a5f

@ianmacartney
ianmacartney merged commit ef450db into main Aug 21, 2026
3 checks passed
@ianmacartney
ianmacartney deleted the ian/debounce-ping-noop branch August 21, 2026 00:30
ianmacartney added a commit that referenced this pull request Aug 21, 2026
Currently, if you `ping` a `BatchWorker` that is going to execute in 3s, but you pass debounceMs of 10s, then it'll re-schedule the worker to run in 10s instead. 
We should instead bias towards running sooner, so timeoutMs is respected when a worker returns that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants