server icon indicating copy to clipboard operation
server copied to clipboard

Configurable retention period for messages.

Open kdurrance opened this issue 5 years ago • 18 comments

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.

kdurrance avatar Dec 29 '20 00:12 kdurrance

Let's wait till more users want this feature.

jmattheis avatar Jan 20 '21 20:01 jmattheis

https://godoc.org/github.com/robfig/cron could be useful for this, if a bit overkill

StewartThomson avatar Jan 21 '21 21:01 StewartThomson

It could be done outside of gotify by only API calls. Check this out: https://github.com/GAS85/Gotify-old_Notifications_cleanup

GAS85 avatar Oct 13 '21 13:10 GAS85

+1 on this feature, would be of great use for me

IvanMazzoli avatar Jun 19 '23 12:06 IvanMazzoli

+1. My app can generate around 100 messages per hour and they are only valid for less than 5 minutes.

felixq avatar Sep 23 '23 16:09 felixq

@jmattheis, I could work on this if you think that this feature is required.

mateuscelio avatar Oct 16 '23 17:10 mateuscelio

@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.

jmattheis avatar Oct 16 '23 18:10 jmattheis