Skip to content

Commit f1f0aa8

Browse files
authored
Merge pull request #2387 from sebkuf/fix_multiple_times_loaded_conf
Increased the performance of the intelmqctl script
2 parents 2331bda + 73c59cb commit f1f0aa8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ CHANGELOG
7575
- `contrib.eventdb.separate-raws-table.sql`: Added the missing commas to complete the sql syntax. (PR#2386, fixes #2125 by Sebastian Kufner)
7676
- `intelmq_psql_initdb`:
7777
- Added parameter `-o` to set the output file destination. (by Sebastian Kufner)
78+
- `intelmqctl`:
79+
- Increased the performance through removing unnecessary reads. (by Sebastian Kufner)
7880

7981
### Known Errors
8082
- `intelmq.parsers.html_table` may not process invalid URLs in patched Python version due to changes in `urllib`. See #2382

intelmq/bin/intelmqctl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
# -*- coding: utf-8 -*-
66
import argparse
7+
import copy
78
import datetime
89
import importlib
910
import json
@@ -925,6 +926,7 @@ def check(self, no_connections=False, check_executables=True):
925926
"intelmqctl upgrade-config.")
926927

927928
check_logger.info('Checking for bots.')
929+
global_settings = files[RUNTIME_CONF_FILE].get('global', {})
928930
for bot_id, bot_config in files[RUNTIME_CONF_FILE].items():
929931
if bot_id != 'global':
930932
# importable module
@@ -939,7 +941,7 @@ def check(self, no_connections=False, check_executables=True):
939941
retval = 1
940942
continue
941943
bot = getattr(bot_module, 'BOT')
942-
bot_parameters = utils.get_global_settings()
944+
bot_parameters = copy.deepcopy(global_settings)
943945
bot_parameters.update(bot_config.get('parameters', {})) # the parameters field may not exist
944946
bot_check = bot.check(bot_parameters)
945947
if bot_check:

0 commit comments

Comments
 (0)