MusicPlayerDaemon / mpdscribble

a MPD client which submits information about tracks being played to a scrobbler (e.g. last.fm)
GNU General Public License v2.0
117 stars 15 forks source link

Scrobbler: Reduce maximum backoff interval to 480 seconds #39

Closed cdown closed 2 years ago

cdown commented 2 years ago

Since mpdscribble is often a long running process, it typically stays running even when the system running it is not connected to the internet. For example, if one brings a laptop on a plane.

In my case, I frequently bring my laptop on planes or trains where internet connectivity is either nonexistent or extremely limited. When I then return to a place where connectivity is restored and play music, it usually takes two hours -- the maximum allowed interval -- before any scrobbles are submitted, as the maximum interval has already been accrued in that time.

This is especially prevalent because the interval is handled by scheduling based on the monotonic forward progress of the system, and so (for example) doesn't advance time when the system is suspended. This means that the interval may in reality be far longer.

Reducing the maximum interval to 480 seconds improves this case: it makes sure we back off acceptably during periods where we cannot contact the API, without running up into intervals that span multiple hours.