AF
Ash Framework•4mo ago
kernel

where's the best place to run possibly long running queries on the DB after an insert / bulk insert?

I have a materialized view which I need to refresh when I either do a bulk load on a table via bulk_create, or an individual insert on it. My initial idea would be to trigger an oban job via an after_action, but just want to clarify how this works for upserts etc.
2 Replies
ZachDaniel
ZachDaniel•4mo ago
Oban job would be the way IMO
kernel
kernelOP•4mo ago
right and after_action will work, just checked the tests 🙂

Did you find this page helpful?