38563b0555
Currently there is no mechanism for deleting tasks on regular basis. This patch adds a new function that is called in the tasks_get_all function, so that everytime tasks lists are called, the function checks if tasks in the database have surpassed the expired_at value. If that is the case, then it sets the deleted value as 1 for all the expired tasks. Co-Authored-By: Mike Fedosin <mfedosin@mirantis.com> Implements https://review.openstack.org/#/c/324648/ Change-Id: I0bde982de948901f6bfbfab9e57cf84891c22052
25 lines
1.1 KiB
YAML
25 lines
1.1 KiB
YAML
---
|
|
prelude: >
|
|
Adds a new function that is called in the
|
|
tasks_get_all function, so that everytime tasks
|
|
lists are called, the function checks if tasks in
|
|
the database have surpassed the expired_at value;
|
|
if that is the case, then it marks the deleted value
|
|
as 1 for all the expired tasks.
|
|
|
|
other:
|
|
- Tasks are soft deleted, in Glance, a resource can
|
|
be soft deleted in the Database Table, these resources
|
|
still exist in the database. The same thing happens
|
|
with tasks; they are marked as deleted using the
|
|
delete flag in the Tasks table which are not queried
|
|
on the regular list or show call. The tasks are not
|
|
instantly deleted because there may be information
|
|
contained in the task resource that may not be
|
|
available elsewhere(For example, a successful
|
|
import task will eventually result in the creation
|
|
of an image in Glance, and it would be useful to
|
|
know the UUID of this image. Similarly, if the
|
|
import task fails, end user should be given time
|
|
to read the task resource to analyze the error
|
|
message.) |