-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Student lesson view calculates a ton of information and often takes a while. We need to materialize this view and have a way to refresh it a few times a day, say every 6 hours.
Scenic, the gem we're using to create views, has a materialize option, so that part is easy to do. However, we need to figure out the refresh part ourselves. We have two approaches available here:
- Leveraging the pg_cron postgres extension: https://github.com/citusdata/pg_cron - this will allow us to refresh materialized view directly in the database, without Rails knowing anything about it.
- Use background jobs
ActiveJobin Rails. This is probably more complicated as we need to use an additional library for the queue backend such asSolidQueuehttps://github.com/rails/solid_queue - this is probably a lot more involved than the first approach, so we should only do it if we encounter a problem in the first approach.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready