android icon indicating copy to clipboard operation
android copied to clipboard

Changing Polling Interval

Open incognito1234 opened this issue 1 year ago • 1 comments

Hello,

I’ve noticed that messages are sent from the application to the server approximately every 20 seconds. This suggests that messages are being polled at this interval.

Would it be possible to increase this polling interval to help minimize battery consumption?

Thank you!

incognito1234 avatar Oct 02 '24 14:10 incognito1234

There is no polling in the app, what you are likely seeing are the websocket ping+pongs and/or http keepalive. On server side these are configurable via

https://github.com/gotify/server/blob/58084c8dea5790796e34540b68d70d4be57395d3/config.example.yml#L4-L5 and https://github.com/gotify/server/blob/58084c8dea5790796e34540b68d70d4be57395d3/config.example.yml#L41-L42

The android app currently has a one minute ping interval https://github.com/gotify/android/blob/master/app/src/main/kotlin/com/github/gotify/service/WebSocketConnection.kt#L48

We could probably add a setting for this in the android app.

jmattheis avatar Oct 02 '24 16:10 jmattheis