-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
fix: count events instead of loading them in memory #3382
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
After enabling |
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.
pair programmed. eventually we'll move parts of the store to a dedicated read model
}), | ||
); | ||
await Promise.all( | ||
statusUpdates.map((statusUpdate) => { |
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.
How many queries can we potentially generate here?
} | ||
schedulerService.schedule( | ||
projectService.statusJob.bind(projectService), | ||
hoursToMilliseconds(24), |
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.
Doing this every 24th hour can be a scary thing, depending on the cost of this query. What happens when a customer have hundreds of projects and a lot of events?
Would love to see some data on the query cost for different setups.
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.
Yep, we'll provide a breakdown of the different test cases including the memory footprint in a follow up PR.
Refactor project events to use count instead of loading the events in memory