Suggest implement clean task for (sys$ScheduledExecution) similar to (sys$AccessToken)

While enable storeTokenInDb, cuba will schedule clean task for cleaning sys$AccessToken.

It will be better to implement similar clean task for sys$ScheduledExecution, allow user to define X, to clean sys$ScheduledExecution X days ago


There is a special JMX bean for this, see Tasks Handling Control.

A quote from the docs:

The removeExecutionHistory() method of the app-core.cuba:type=Scheduling JMX bean can be used to remove old execution history. The method has two parameters:

  • age – the time (in hours) elapsed after the task execution.
  • maxPeriod – the maximum Period (in hours) for tasks that should have their execution history removed. This enables removing the history for frequently run tasks only, while keeping the history for tasks executed once a day.

The method can be invoked automatically. Create a new task with the following parameters:

  • Bean namecuba_SchedulingMBean
  • Method nameremoveExecutionHistory(String age, String maxPeriod)
  • Method parameters – for example, age = 72, maxPeriod = 12.

That’s great. Will try.

Thanks Konstantin.