antikythera v0.4.0 mix antikythera_core.delete_obsolete_assets View Source

Deletes obsolete asset files in asset storage.

To judge whether each asset file should be kept or deleted we use "asset list file"s. Each asset list file is created during deployment of a gear version (see Mix.Tasks.AntikytheraCore.UploadNewAssetVersions).

Based on the asset retention policy described in the moduledoc of Antikythera.Asset, it can be seen that, within all existing asset list files, only the following ones are relevant:

  1. asset list files created within the latest 90 days
  2. the latest asset list file among ones created up to 90 days before

Assets included in any of the relevant asset list files should be kept. Assets not included in all of the relevant asset list files are "obsolete"; they should be deleted.

Link to this section Summary

Functions

Callback implementation for Mix.Task.run/1.

Link to this section Functions

Callback implementation for Mix.Task.run/1.