add 'sleep-extractor' option (closes #964)

(would have been nice if this were possible without code duplication)
This commit is contained in:
Mike Fährmann
2020-09-12 21:04:47 +02:00
parent 3108e85b89
commit 3afd362e2e
2 changed files with 17 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ class Job():
def run(self):
"""Execute or run the job"""
sleep = self.extractor.config("sleep-extractor")
if sleep:
time.sleep(sleep)
try:
log = self.extractor.log
for msg in self.extractor:
@@ -586,6 +589,10 @@ class DataJob(Job):
self.filter = (lambda x: x) if private else util.filter_dict
def run(self):
sleep = self.extractor.config("sleep-extractor")
if sleep:
time.sleep(sleep)
# collect data
try:
for msg in self.extractor: