Logging of timeout

This commit is contained in:
Ruben van de Ven 2019-11-12 16:13:57 +01:00
parent 76905102b4
commit bf54a7a8af
1 changed files with 3 additions and 3 deletions

View File

@ -319,7 +319,7 @@ class CommandHandler(object):
t = None t = None
if duration is not 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() t.start()
self.playPopen = subprocess.Popen( self.playPopen = subprocess.Popen(
@ -357,7 +357,7 @@ class CommandHandler(object):
'msgId': msgId 'msgId': msgId
}) })
def checkPopen(self, msgId): def checkPopen(self, msgId, duration):
if self.playingMsgId != msgId: if self.playingMsgId != msgId:
return return
@ -365,7 +365,7 @@ class CommandHandler(object):
return return
# prevent a lock of the story, no repeat or anything for now # 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() self.playPopen.kill()
def cmdStop(self, msgId): def cmdStop(self, msgId):