kobotoolbox / kobocat

Our (backend) server for providing blank forms to Collect and Enketo and for receiving and storing submissions.
BSD 2-Clause "Simplified" License
117 stars 127 forks source link

Add revision cleanup task #924

Closed jamesrkiger closed 6 months ago

jamesrkiger commented 7 months ago

Adds a daily perform_maintenance Celery task and implements cleanup for old django-reversion revisions based on work in #579 .

The actual revision cleanup work is drastically simplified here. The django admin command used in the previous PR was based on django-reversion's own admin command and was made much more complicated than necessary for our use case because of the abstraction the django-reversion command affords. The tables for revisions and versions in Kobocat are potentially enormous, so I decided that the simplest approach was the best, rather than filtering and iterating over hundreds of millions of rows.