File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,12 @@ def get_ringtone(self):
448448 self ._sendAdmin (
449449 p1 , wantResponse = True , onResponse = self .onResponseRequestRingtone
450450 )
451- while self .gotResponse is False :
451+ start_time = time .time ()
452+ timeout = 2
453+ while not self .gotResponse :
454+ if time .time () - start_time > timeout :
455+ logging .warning ("Timeout waiting for ringtone plugin response" )
456+ return None
452457 time .sleep (0.1 )
453458
454459 logging .debug (f"self.ringtone:{ self .ringtone } " )
@@ -521,7 +526,13 @@ def get_canned_message(self):
521526 wantResponse = True ,
522527 onResponse = self .onResponseRequestCannedMessagePluginMessageMessages ,
523528 )
524- while self .gotResponse is False :
529+
530+ start_time = time .time ()
531+ timeout = 2
532+ while not self .gotResponse :
533+ if time .time () - start_time > timeout :
534+ logging .warning ("Timeout waiting for canned message plugin response" )
535+ return None
525536 time .sleep (0.1 )
526537
527538 logging .debug (
You can’t perform that action at this time.
0 commit comments