Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable retention period for messages. #376

Open
kdurrance opened this issue Dec 29, 2020 · 7 comments
Open

Configurable retention period for messages. #376

kdurrance opened this issue Dec 29, 2020 · 7 comments
Labels
a:feature New feature or request request-for-comments

Comments

@kdurrance
Copy link

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 kdurrance added the a:feature New feature or request label Dec 29, 2020
@jmattheis
Copy link
Member

jmattheis commented Jan 20, 2021

Let's wait till more users want this feature.

@StewartThomson
Copy link
Contributor

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

@GAS85
Copy link

GAS85 commented Oct 13, 2021

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

@IvanMazzoli
Copy link

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

@felixq
Copy link

felixq commented Sep 23, 2023

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

@mateuscelio
Copy link
Contributor

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

@jmattheis
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request request-for-comments
Development

No branches or pull requests

7 participants