From bf54a7a8afb169deaddad0b3ec0d483e88cbb82c Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 12 Nov 2019 16:13:57 +0100 Subject: [PATCH] Logging of timeout --- hugvey/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hugvey/client.py b/hugvey/client.py index 5d5805c..f1abd85 100644 --- a/hugvey/client.py +++ b/hugvey/client.py @@ -319,7 +319,7 @@ class CommandHandler(object): t = None if duration is not None: - t = threading.Timer(duration+3, self.checkPopen, (msgId,)) + t = threading.Timer(duration+3, self.checkPopen, (msgId,duration+3)) t.start() self.playPopen = subprocess.Popen( @@ -357,7 +357,7 @@ class CommandHandler(object): 'msgId': msgId }) - def checkPopen(self, msgId): + def checkPopen(self, msgId, duration): if self.playingMsgId != msgId: return @@ -365,7 +365,7 @@ class CommandHandler(object): return # prevent a lock of the story, no repeat or anything for now - logger.critical("Interrupting playback after timeout: {}".format(self.playingMsgId)) + logger.critical("Interrupting playback after timeout of {}: {}".format(str(duration), self.playingMsgId)) self.playPopen.kill() def cmdStop(self, msgId):