Skip to content

Commit

Permalink
Add timeout to debounce (#467)
Browse files Browse the repository at this point in the history
Adds maximum timeouts to debounces in function configuration.

- [x] Added a [docs PR](https://github.com/inngest/website) that
references this PR
- [x] Added unit/integration tests
- [x] Added changesets if applicable
  • Loading branch information
tonyhb committed Jan 16, 2024
1 parent ecde5b6 commit ca93ef8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-mayflies-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": minor
---

Add timeouts to debounce configuration
1 change: 1 addition & 0 deletions packages/inngest/etc/inngest.api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/inngest/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,16 @@ export interface FunctionOptions<
* information.
*/
period: TimeStr;

/**
* The maximum time that a debounce can be extended before running.
* If events are continually received within the given period, a function
* will always run after the given timeout period.
*
* See [Debounce documentation](https://innge.st/debounce) for more
* information.
*/
timeout?: TimeStr;
};

/**
Expand Down

0 comments on commit ca93ef8

Please sign in to comment.