Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

Commit

Permalink
add max_timeout for cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ysh329 committed Aug 9, 2020
1 parent e61debb commit c968a60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions core/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
sys.path.append("..")
from utils.log import LoggerCreator # noqa

##############################
# Global Config
##############################
log_enable_debug = True
logger_creator = LoggerCreator(log_enable_debug)
logger = logger_creator.create_logger()
GPU_REPEATS = 1000 # 1000
CPU_REPEATS = 100 # 100
WARMUP = 20 # 20
MAX_TIMEOUT_SECOND = 250
MAX_TIMEOUT_SECOND_ONCE_INFER = 0.5
MAX_TIMEOUT_SECOND = 10 # 10, not used for infer command
MAX_TIMEOUT_SECOND_ONCE_INFER = 0.5 # used to calc MAX_TIMEOUT_SECOND


def create_config(framework_name):
Expand Down
4 changes: 2 additions & 2 deletions utils/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import unittest

sys.path.append("..")
from core.global_config import logger # noqa
from core.global_config import logger, MAX_TIMEOUT_SECOND # noqa


def run_cmd(cmd, wait_interval_sec=5, max_timeout_sec=100):
def run_cmd(cmd, wait_interval_sec=5, max_timeout_sec=MAX_TIMEOUT_SECOND):
cmd_type = "CMD"
logger.info("{}> {}".format(cmd_type, cmd))
subp = subprocess.Popen(
Expand Down

0 comments on commit c968a60

Please sign in to comment.