Skip to content
Snippets Groups Projects
Commit 8f9763d6 authored by Pavel Kácha's avatar Pavel Kácha
Browse files

Added poll cmdline option

parent 02c9417e
Branches
No related tags found
No related merge requests found
...@@ -396,6 +396,12 @@ def get_args(): ...@@ -396,6 +396,12 @@ def get_args():
dest="oneshot", dest="oneshot",
action="store_true", action="store_true",
help="process files and quit (do not daemonize)") 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", optp.add_option("-p", "--pid",
default=pth.join("/var/run", pth.splitext(pth.basename(sys.argv[0]))[0] + ".pid"), default=pth.join("/var/run", pth.splitext(pth.basename(sys.argv[0]))[0] + ".pid"),
dest="pid", dest="pid",
...@@ -489,7 +495,7 @@ def main(): ...@@ -489,7 +495,7 @@ def main():
f.open() f.open()
reload_flag = False reload_flag = False
if not any(line_set): if not any(line_set):
time.sleep(1) time.sleep(opts.poll)
line = "" line = ""
aggr = [] aggr = []
for context in contexts: for context in contexts:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment