From daa5c8039d6e5bdb7c6d053d7021f80384568395 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 12 Jun 2019 15:46:51 +0200 Subject: [PATCH] [DEV] add tool to generize the wait config --- island/tools.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/island/tools.py b/island/tools.py index eea9edf..7ecd927 100644 --- a/island/tools.py +++ b/island/tools.py @@ -13,6 +13,7 @@ import shutil import errno import fnmatch import stat +import time # Local import from realog import debug from . import env @@ -295,4 +296,16 @@ def get_list_base_display(id, count, elem): return str(id) + "/" + str(count) + " : " + str(elem.path) +is_first_time_sleep = True + +def wait_for_server_if_needed(): + global is_first_time_sleep + if is_first_time_sleep == False: + is_first_time_sleep = True; + return + if env.get_wait_between_sever_command() != 0: + debug.info("Wait for server contrition (" + str(env.get_wait_between_sever_command()) + " s)") + time.sleep(env.get_wait_between_sever_command()) + +