cube
cube copied to clipboard
How do I make the scheduledRefresh parameter work?
Problem
I am trying to test some possibilities where the pre-aggregation is always created at the moment of an API request, and from the documentation the scheduledRefresh set to false seems to be the best option. But when I analyze the logs and response time, it looks like Cube isn't "forcing" a new version of the pre-aggregation to be generated (for both rollup or rollupjoins). Am I misunderstanding the parameter's function? Or do I need to add something else to the Docker config file?
@Martelloti can you kindly share the docker config file ? Correct me if I'm wrong , but you want the pre-aggregations to be built only for when the API is triggered right ?
@Martelloti Could you share your Cube version please? Hvae you tried using something earlier than 0.30.34 or adding env var CUBEJS_PRE_AGGREGATIONS_BUILDER=true?
There's no way to force Cube to refresh pre-aggregation on per request basis, and generally speaking, it's an anti-pattern as it's a heavy operation most of the time. If the newest portion of data is a requirement, then https://cube.dev/docs/caching/pre-aggregations/lambda-pre-aggregations could be used instead.