Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throttle across multiple processes #35

Closed
jaschaio opened this issue Jan 31, 2022 · 2 comments
Closed

throttle across multiple processes #35

jaschaio opened this issue Jan 31, 2022 · 2 comments

Comments

@jaschaio
Copy link

Any insights how I would do this if I am hitting an API from multiple node processes and thus need to limit the execution across all processes?

@jaschaio
Copy link
Author

It's probably not the right tool for the job.

My best guess is to use a single redis key across all processes that counts the number of executions and when the limit is reached wait's for a certain time.

See https://redis.io/commands/INCR

@sindresorhus
Copy link
Owner

I would also use Redis for this.

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

No branches or pull requests

2 participants