rafalp / Misago

Misago is fully featured modern forum application that is fast, scalable and responsive.
http://misago-project.org
GNU General Public License v2.0
2.55k stars 528 forks source link

Create hidden "garbage bin" category, move threads to it before deleting them #976

Open rafalp opened 6 years ago

rafalp commented 6 years ago

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.

AetherUnbound commented 5 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?

rafalp commented 5 years ago

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. ;)

rafalp commented 3 months ago

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.