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