Open rafalp opened 6 years ago
In order to accomplish this, would it be this function that would need to be modified to move the thread to that garbage category first instead of deleting?
And would something like this be an example of a celery task that this might be based on?
Yup, delete_thread
should use the thread.move()
instead of thread.delete()
. As for creating celery task, you can take inspiration from that one, yes. Even simpler would be to abuse prunethreads
management command by setting prune_replied_after
for garbage bin category. ;)
I'll do this for 0.40 because its better to delete attachments fastly, but moving threads to a garbage can category first and deleting them with a Celery beat task will be faster than waiting for the mod action to do its thing.
Bulk thread deletion may be costful and slow if moderator deletes thread with plenty of posts, but this can be improved by changing thread deletion action to actually move the thread to hidden category invisible to all users instead of deleting it on HTTP thread.
This category could then be pruned automatically by either cron job or celery task.