Plex endless loop when no clients connected
This commit is contained in:
@@ -38,16 +38,13 @@ class Plex(Notification):
|
|||||||
def notifyClients(self, message, client_names):
|
def notifyClients(self, message, client_names):
|
||||||
success = True
|
success = True
|
||||||
|
|
||||||
while len(client_names):
|
for client_name in client_names:
|
||||||
client_name = client_names[0]
|
|
||||||
client_success = False
|
client_success = False
|
||||||
client = self.server.clients.get(client_name)
|
client = self.server.clients.get(client_name)
|
||||||
|
|
||||||
if client and client['found']:
|
if client and client['found']:
|
||||||
client_success = fireEvent('notify.plex.notifyClient', client, message, single=True)
|
client_success = fireEvent('notify.plex.notifyClient', client, message, single = True)
|
||||||
|
|
||||||
if client_success:
|
|
||||||
client_names.pop(0)
|
|
||||||
|
|
||||||
if not client_success:
|
if not client_success:
|
||||||
if self.server.staleClients() or not client:
|
if self.server.staleClients() or not client:
|
||||||
@@ -56,7 +53,6 @@ class Plex(Notification):
|
|||||||
self.server.updateClients(self.getClientNames())
|
self.server.updateClients(self.getClientNames())
|
||||||
else:
|
else:
|
||||||
log.warning('Failed to send notification to client %s, skipping this time', client_name)
|
log.warning('Failed to send notification to client %s, skipping this time', client_name)
|
||||||
client_names.pop(0)
|
|
||||||
success = False
|
success = False
|
||||||
|
|
||||||
return success
|
return success
|
||||||
|
|||||||
Reference in New Issue
Block a user