Feature #8144
closedAdd a purge mechanism for tasks
Description
I'm currently using foreman-tasks to process facts (from foreman_chef) uploading (and hopefully reports one day).
It creates a lot of tasks per hour and I don't see any point to keep in db all that tasks.
IMHO it would be very useful to have a purge mechanism : it may have to run as a cron task ?
Thoughts ?
Updated by Ivan Necas about 10 years ago
Thank you for reporting. I agree we need a purge mechanism to be there. Since the foreman-tasks
can have an auditing value as well (especially once they will get wider usage - and they don't
have to be used only for async tasks, but for audit as well), I would like to make it more
configurable. Also, some task info are more valuable than the others. What about this suggestion:
1. There are two purge mechanisms: reduce (would keep just subset of the original data, for audit purposes) and delete
2. It's possible to export the data to disk for archiving.
3. it would be possible to configure a combination of [priority, scoped-search filter + age, purge mechanism, export (true, false)]
and a task (either a rake task, or some foreman-task itself) would periodically clean the data.
Updated by The Foreman Bot almost 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman-tasks/pull/100 added
- Pull request deleted (
)
Updated by Ivan Necas almost 10 years ago
This adds a rake task for cleaning tasks based on filter and age. Example:
# delete all the tasks of rake foreman_tasks:clean FILTER='label = "Actions::Foreman::Host::ImportFacts"' # delete all tasks older than 30 days rake foreman_tasks:clean BEFORE=2592000 # delete all tasks older than 10 days (the default BEFORE value) rake foreman_tasks:clean
It doesn't touch tasks that are in other than running or paused state. Opinions?
Updated by Marek Hulán almost 10 years ago
Visually the PR looks very nice, I didn't tested though. One thing that I don't see is the export feature (point 3. in your comment) but we may open separate issue for this as we may think of adding also a way to reimport.
Updated by Ivan Necas over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset fb88f07788fcef2a0ae5e5ed4d4e4629c3f6411a.