cube icon indicating copy to clipboard operation
cube copied to clipboard

How do I make the scheduledRefresh parameter work?

Open Martelloti opened this issue 1 year ago • 2 comments

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 avatar Jul 21 '22 18:07 Martelloti

@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 ?

shaikwasef avatar Jul 22 '22 08:07 shaikwasef

@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?

ivan-vdovin avatar Jul 22 '22 14:07 ivan-vdovin

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.

paveltiunov avatar Nov 27 '22 22:11 paveltiunov