-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add rate limited notifications queue #4162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work on this one @davecreaser 🙌
Applied the changes in the local block-ingestor
and created a mint tokens action
There were no errors in the console
Added an extra log to check the queue size and it seems the extra 20
notifications compared to the queue cap were added
However @davecreaser, after creating many more Mint tokens actions, I did manage to still spot the API limit reached
error. Not sure if I did something wrong?
Thanks @mmioana, turns out they had more I've reduced the block ingestor rate to only send 30 per minute, which will keep us nicely within the limits, and leave a big buffer for the front end to make requests. Also added a retry mechanism with priority to the notifications queue, so that notifications which still hit the rate limit (unlikely hopefully) will get retried. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your really cool work on this issue @davecreaser 🥇
Applied the local changes to the block ingestor and created a Mint tokens
action
Immediately I got 30
notifications
No errors on the block ingestor side
After 1 minute I got 30
more new notifications
And after another minute, all notifications were there
Awesome work! 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Testing
npm run dev --notifications
to enable notifications locally..env
of the CDapp and copy the auto generated MAGICBELL_DEV_KEY, and add it to the.env
of your block ingestor. Now run the block ingestor locally withnpm run dev
.src/handlers/actions/mintTokens.ts
in the block ingestor, and go to line 35 where it callssendPermissionsActionNotifications
. Just add a for loop around this call to fire it like 80 times when a mint token action happens.Diffs
Changes 🏗