ReviewBot: make interval work without tty
This commit is contained in:
parent
35e7c51c16
commit
78de99ff82
@ -33,6 +33,7 @@ from osclib.memoize import memoize
|
||||
from osclib.stagingapi import StagingAPI
|
||||
import signal
|
||||
import datetime
|
||||
import time
|
||||
import yaml
|
||||
|
||||
try:
|
||||
@ -697,6 +698,7 @@ class CommandLineInterface(cmdln.Cmdln):
|
||||
self.logger.exception(e)
|
||||
|
||||
if interval:
|
||||
if os.isatty(0):
|
||||
self.logger.info("sleeping %d minutes. Press enter to check now ..."%interval)
|
||||
signal.alarm(interval*60)
|
||||
try:
|
||||
@ -705,6 +707,9 @@ class CommandLineInterface(cmdln.Cmdln):
|
||||
pass
|
||||
signal.alarm(0)
|
||||
self.logger.info("recheck at %s"%datetime.datetime.now().isoformat())
|
||||
else:
|
||||
self.logger.info("sleeping %d minutes." % interval)
|
||||
time.sleep(interval * 60)
|
||||
continue
|
||||
break
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user