Skip to content

Delete unwanted host records in batches

Lukas Eipert requested to merge leipert-prune-affected-hosts into main

Delete unwanted host records in batches

This adds a batched migration, which:

  1. Finds all CurrentHostStats within the range of ids
  2. that have not a single Usage Ping
  3. that have been created this year

Then we start an iteration over those candidates:

  1. Continue, if there exists a UsagePingError for the host
  2. Get all version checks for the related host
  3. continue, if a single version check is safe to keep
  4. Otherwise deletes: VersionChecks, CurrentHostStats related to the host and the host itself.
Edited by Lukas Eipert

Merge request reports

Loading