Feature #8144
closed
Add a purge mechanism for tasks
Added by Romain Vrignaud about 10 years ago.
Updated over 9 years ago.
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 ?
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.
- Status changed from New to Assigned
- Assignee set to Ivan Necas
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman-tasks/pull/100 added
- Pull request deleted (
)
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?
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.
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF