Cleanup policies: move counts/metrics to the parent worker

Problem

Right, when executing cleanup policies, the limited capacity worker is computing the counts of:

  • scheduled cleanups
  • unfinished cleanups

combined they represent the cleanups left to go through.

The limited capacity worker doing writes, it hits the primary database

Proposal

Move these counts to the parent cron worker and make it hit the replica.

Impacts

  • These metrics/counts will be computed in an hourly manner instead of many times per hour.
Assignee Loading
Time tracking Loading