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):