From a63e328f1562b47a8d44373db29bb9c74df9cd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20K=C3=A1cha?= <ph@cesnet.cz> Date: Thu, 27 Apr 2017 16:57:37 +0200 Subject: [PATCH] Added poll cmdline option --- warden3/contrib/connectors/hp-labrea/labrea-idea.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/warden3/contrib/connectors/hp-labrea/labrea-idea.py b/warden3/contrib/connectors/hp-labrea/labrea-idea.py index bf1f226..89ef6f1 100755 --- a/warden3/contrib/connectors/hp-labrea/labrea-idea.py +++ b/warden3/contrib/connectors/hp-labrea/labrea-idea.py @@ -396,6 +396,12 @@ def get_args(): dest="oneshot", action="store_true", help="process files and quit (do not daemonize)") + optp.add_option("--poll", + default=1, + dest="poll", + type="int", + action="store", + help="log file polling interval") optp.add_option("-p", "--pid", default=pth.join("/var/run", pth.splitext(pth.basename(sys.argv[0]))[0] + ".pid"), dest="pid", @@ -489,7 +495,7 @@ def main(): f.open() reload_flag = False if not any(line_set): - time.sleep(1) + time.sleep(opts.poll) line = "" aggr = [] for context in contexts: -- GitLab