Creating persistent models in Holistics 4.0

In Holistics 4.0 there is new way to create persistent models but I can’t find a way to make it work.
I used this page for help : Persistence Query Model | Holistics Docs

I have added this block to two of my models :

  persistence: FullPersistence  {
    schema: 'holistics_imports'

and created the schedule.aml file next to index.aml :

import './matomo_final/evenements.model.aml' {evenements}
import './matomo_final/pages_vues.model.aml' {pages_vues}

const schedules = [
  Schedule  {
    models: [evenements, pages_vues]
    cron: '*/15 * * * *'

but nothing happens.
Am I doing it wrong ?
How can I debug this ? Are there logs somewhere ?

Thanks in advance for your help !

1 Like

Hi @dacou , have you deployed to production? The persistence can only be executed in the production area.

Hi @Khai_To , Yes I did

Hi @dacou,

The filename to set schedules should be schedules.aml (with an s).
We omitted that in our public doc, we will fix it soon.

Do let me know if you have any support.

Thanks it worked !
But there may be an issue with the retention policy of persistent models. Apparently Holistics creates a new table everytime it refreshes a persistent model but it does not appear to delete older tables.
Is it normal ?

Hi @dacou,

The persisted table will be invalidated in 2 cases.
You can refer to this doc Persistence Query Model | Holistics Docs for more information

Alright, understood. Even old versions of a persisted table are kept for 24 hours.

So we should not schedule refreshes too often otherwise the size of the database will get out of control. Do you plan to give us more control on that retention delay ?

For now, we don’t have a plan to make the persisted_table’s invalidation controllable @dacou.
However, we totally understand that your schema might be messy if you’re unable to control the persistence invalidation opearation. I will note this down and improve it in the future