Closed ghost closed 11 months ago
I have tested this extensively but it would be better if someone could review this to make sure its efficient. Also since setting the config option will immediately start deleting old logs not sure if we should have some kind of safeguard?
I think a safeguard is probably a good measure just to make sure nobody does anything they'd rather not do
I think a safeguard is probably a good measure just to make sure nobody does anything they'd rather not do
Actually if you look at it, the config option is set after the bot is running, they will need to restart the bot for it to come into effect. In this time they can remove the config option to prevent logs from being deleted. However vise versa if the logs are being deleted and they remove the config option, the deletion will stop without needing a restart.
Maybe this is enough?
@lorenzo132 What do you think?
@lorenzo132 What do you think?
I'm a fan of the logs expiration config, specialy on a company wise level this is a very nice feature to have.
Used delete_many
instead of looping delete_one
based on recommendation by @khakers
All requested changes have been done and tested.
I did a couple of quick tests. Seems working fine for me.
Closes #2942
This pr adds a config option called
log_expiration
which can be configured in the same way asthread_cooldown
etc. According to theclosed_at
field this config option will delete logs which have passed the time specified inlog_expiration
.This will work retrospectively.