fedeya / remix-sitemap

Sitemap generator for Remix applications
https://npmjs.com/remix-sitemap
MIT License
95 stars 5 forks source link

Feature: optional rate limiter on concurrent sitemap functions executed #62

Closed AjaniBilby closed 10 months ago

AjaniBilby commented 10 months ago

Adds an optional config property rateLimit which restricts the number of sitemap functions that can execute concurrently, reducing the potential chances of hitting connection limits on a db.

If no connection limit is set, there is no change to execution behaviour.

I was unable to test this code actually works as there are multiple peer dependecy conflicts preventing me from building the project, however it should thoretically work.

This should also fix issue #61

fedeya commented 10 months ago

can you add some tests to rate limiter?

AjaniBilby commented 10 months ago

I'm flying blind on these units tests, as I still can't compile and run due to dependency issues, but hopefully they should work...

>npm i
npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @remix-run/dev@2.2.0
npm ERR! Found: typescript@4.9.5
npm ERR! node_modules/typescript
npm ERR!   peerOptional typescript@"^5.1.0" from @remix-run/node@2.2.0
npm ERR!   node_modules/@remix-run/dev/node_modules/@remix-run/node
npm ERR!     @remix-run/node@"2.2.0" from @remix-run/dev@2.2.0
npm ERR!     node_modules/@remix-run/dev
npm ERR!       dev @remix-run/dev@"^2.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^5.1.0" from @remix-run/dev@2.2.0
npm ERR! node_modules/@remix-run/dev
npm ERR!   dev @remix-run/dev@"^2.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript@5.2.2
npm ERR! node_modules/typescript
npm ERR!   peerOptional typescript@"^5.1.0" from @remix-run/dev@2.2.0
npm ERR!   node_modules/@remix-run/dev
npm ERR!     dev @remix-run/dev@"^2.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
fedeya commented 10 months ago

I'm flying blind on these units tests, as I still can't compile and run due to dependency issues, but hopefully they should work...


>npm i

npm WARN ERESOLVE overriding peer dependency

npm ERR! code ERESOLVE

npm ERR! ERESOLVE could not resolve

npm ERR!

npm ERR! While resolving: @remix-run/dev@2.2.0

npm ERR! Found: typescript@4.9.5

npm ERR! node_modules/typescript

npm ERR!   peerOptional typescript@"^5.1.0" from @remix-run/node@2.2.0

npm ERR!   node_modules/@remix-run/dev/node_modules/@remix-run/node

npm ERR!     @remix-run/node@"2.2.0" from @remix-run/dev@2.2.0

npm ERR!     node_modules/@remix-run/dev

npm ERR!       dev @remix-run/dev@"^2.0.0" from the root project

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peerOptional typescript@"^5.1.0" from @remix-run/dev@2.2.0

npm ERR! node_modules/@remix-run/dev

npm ERR!   dev @remix-run/dev@"^2.0.0" from the root project

npm ERR!

npm ERR! Conflicting peer dependency: typescript@5.2.2

npm ERR! node_modules/typescript

npm ERR!   peerOptional typescript@"^5.1.0" from @remix-run/dev@2.2.0

npm ERR!   node_modules/@remix-run/dev

npm ERR!     dev @remix-run/dev@"^2.0.0" from the root project

npm ERR!

npm ERR! Fix the upstream dependency conflict, or retry

npm ERR! this command with --force or --legacy-peer-deps

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

The project is using pnpm as a package manager

fedeya commented 10 months ago

LGTM! Thanks 🚀