mpd: Add MPD_SERVER_CONNECTION_TIMEOUT setting
This commit is contained in:
parent
8baf813fb6
commit
79cbdb4fbb
@ -15,6 +15,10 @@ v0.11.0 (in development)
|
||||
|
||||
**MPD frontend**
|
||||
|
||||
- Add :attr:`mopidy.settings.MPD_SERVER_CONNECTION_TIMEOUT` setting which
|
||||
controls how long an MPD client can stay inactive before the connection is
|
||||
closed by the server.
|
||||
|
||||
- Add support for the ``findadd`` command.
|
||||
|
||||
- Updated to match the MPD 0.17 protocol (Fixes: :issue:`228`):
|
||||
|
||||
@ -23,7 +23,8 @@ class MpdFrontend(pykka.ThreadingActor, CoreListener):
|
||||
network.Server(
|
||||
hostname, port,
|
||||
protocol=session.MpdSession, protocol_kwargs={'core': core},
|
||||
max_connections=settings.MPD_SERVER_MAX_CONNECTIONS)
|
||||
max_connections=settings.MPD_SERVER_MAX_CONNECTIONS,
|
||||
timeout=settings.MPD_SERVER_CONNECTION_TIMEOUT)
|
||||
except IOError as error:
|
||||
logger.error(
|
||||
'MPD server startup failed: %s',
|
||||
|
||||
@ -174,6 +174,16 @@ MIXER = 'autoaudiomixer'
|
||||
#: MIXER_TRACK = None
|
||||
MIXER_TRACK = None
|
||||
|
||||
#: Number of seconds an MPD client can stay inactive before the connection is
|
||||
#: closed by the server.
|
||||
#:
|
||||
#: Used by :mod:`mopidy.frontends.mpd`.
|
||||
#:
|
||||
#: Default::
|
||||
#:
|
||||
#: MPD_SERVER_CONNECTION_TIMEOUT = 60
|
||||
MPD_SERVER_CONNECTION_TIMEOUT = 60
|
||||
|
||||
#: Which address Mopidy's MPD server should bind to.
|
||||
#:
|
||||
#: Used by :mod:`mopidy.frontends.mpd`.
|
||||
|
||||
@ -291,7 +291,7 @@ class Connection(object):
|
||||
return True
|
||||
|
||||
def timeout_callback(self):
|
||||
self.stop('Client timeout out after %s seconds' % self.timeout)
|
||||
self.stop('Client inactive for %ds; closing connection' % self.timeout)
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user