Open kdurrance opened 3 years ago
Let's wait till more users want this feature.
https://godoc.org/github.com/robfig/cron could be useful for this, if a bit overkill
It could be done outside of gotify by only API calls. Check this out: https://github.com/GAS85/Gotify-old_Notifications_cleanup
+1 on this feature, would be of great use for me
+1. My app can generate around 100 messages per hour and they are only valid for less than 5 minutes.
@jmattheis, I could work on this if you think that this feature is required.
@mateuscelio I don't think this feature is required, but feel free to work on it.
For the implementation: Each application should get a separate setting for the retention period. The pruning should be done in a separate goroutine that executes an sql query every minute to prune messages outside of the retention period. The default retention period should be unlimited.
Pretty self explanatory. Option to automatically prune old messages from the gotify.db en masse. I have a particular chatty application for notifications, which over time could be an issue. Would be great to have configurable retention period for messages, either as a global setting, or an a per-application basis.