mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 14:05:59 -03:30
add support for db partition in cleanup_jobs
Changes in old unpartitioned cleanup logic: * Manually cascade delete events related to job(s) (new partitions cleanup logic) For each event type: * Get the event partitions that are within the cleanup date range * Get a list of jobs to delete that are in the cutoff range. * Jobs that are running, pending, or waiting in the job list are special. * Use the special list to further filter the partition drop list. * Drop partitions * delete jobs
This commit is contained in:
@@ -52,6 +52,11 @@ class UnifiedJobDeletionMixin(object):
|
||||
else:
|
||||
# if it has been > 1 minute, events are probably lost
|
||||
logger.warning('Allowing deletion of {} through the API without all events ' 'processed.'.format(obj.log_format))
|
||||
|
||||
# Manually cascade delete events if unpartitioned job
|
||||
if obj.has_unpartitioned_events:
|
||||
obj.get_event_queryset().delete()
|
||||
|
||||
obj.delete()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user