Skip to content

Commit 27cf8ca

Browse files
Lukas-Heindlsebix
authored andcommitted
make amount of retries configurable
1 parent 386a144 commit 27cf8ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

intelmq/bin/intelmqctl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,14 @@ def botnet_stop(self, group=None):
567567
# only aliasing the list to ease reading the following
568568
stopped_but_still_running_bots = bots
569569

570-
# parameters:
570+
retries = getattr(self._parameters, 'stop_retry_limit', 5)
571+
572+
# parameters (default):
571573
# - sleep 0.75 s with an increment of 0.1
572574
# - at most 5 tries
573575
# => sleep-ing at most 4.75 seconds
574576
sleep_time = 0.75 # in seconds
575-
for _ in range(5):
577+
for _ in range(retries):
576578
# give the bots some time to terminate
577579
time.sleep(sleep_time)
578580
# update the botnet_status

0 commit comments

Comments
 (0)