fix: timer state control
This commit is contained in:
@@ -224,8 +224,13 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
||||
|
||||
@classmethod
|
||||
def perform(cls):
|
||||
if status == Status.RUNNING: return False
|
||||
sleep(0.2); return True
|
||||
if status == Status.RUNNING:
|
||||
timer.start()
|
||||
return False
|
||||
|
||||
timer.pause()
|
||||
sleep(0.2)
|
||||
return True
|
||||
|
||||
class Timeout(Action):
|
||||
clock = Timer()
|
||||
@@ -238,8 +243,10 @@ def main(driver: Chrome, logger = logging.getLogger('main')):
|
||||
|
||||
@classmethod
|
||||
def perform(cls):
|
||||
if cls.clock.delta() > parameters['timeout']: raise cls
|
||||
sleep(0.2); return True
|
||||
if cls.clock.delta() > parameters['timeout']:
|
||||
raise cls
|
||||
sleep(0.2)
|
||||
return True
|
||||
|
||||
class Acknowledge(Action):
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user