The watcher.db.purge
Module¶
-
class
watcher.db.purge.
PurgeCommand
(age_in_days=None, max_number=None, uuid=None, exclude_orphans=False, dry_run=None)[source]¶ Bases:
object
Purges the DB by removing soft deleted entries
The workflow for this purge is the following:
# Find soft deleted objects which are expired # Find orphan objects # Find their related objects whether they are expired or not # Merge them together # If it does not exceed the limit, destroy them all
-
find_objects_to_delete
()[source]¶ Finds all the objects to be purged
Returns: A mapping with all the Watcher objects to purged Return type: WatcherObjectsMap
instance
-
-
class
watcher.db.purge.
WatcherObjectsMap
[source]¶ Bases:
object
Wrapper to deal with watcher objects per type
This wrapper object contains a list of watcher objects per type. Its main use is to simplify the merge of watcher objects by avoiding duplicates, but also for representing the relationships between these objects.