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

feat: restrict in flight psa requests with max quota #1974

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vasco-santos
Copy link
Contributor

This PR adds a route middleware to routes POST /pins and /pins/:requestId, augmenting the authorization layer to also check the on going requests. We also have a ENV var that we can add to override the current default of 100 in flight requests.

100 was chosen arbitrarily given I don't have any nice metrics to get a better number, so open for suggestions here.

Closes #1870

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 9, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4393c43
Status: ✅  Deploy successful!
Preview URL: https://db75466b.nft-storage-1at.pages.dev
Branch Preview URL: https://feat-restrict--in-flight-psq.nft-storage-1at.pages.dev

View logs

@vasco-santos vasco-santos force-pushed the feat/restrict/-in-flight-psq-requests-with-max-quota branch from c784e9c to 4393c43 Compare June 9, 2022 13:40
Copy link
Contributor

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that pin status is updated asynchronously every 10 minutes, so folks might reach their quota quickly and then have to wait a long time to continue...

@vasco-santos
Copy link
Contributor Author

The issue is that pin status is updated asynchronously every 10 minutes, so folks might reach their quota quickly and then have to wait a long time to continue...

Should we look for Pins created older than 10 minutes to start with? I think there is no great solution for this while we have Pin Status as is

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.

Max pending/unpinned quota
2 participants