Skip to content

Commit

Permalink
FIX: Fixed re-reloading the harmonization file after each iteration
Browse files Browse the repository at this point in the history
As of now each new message re-loads the actual harmonization conf,
which unfortuneatly results in a high CPU drain.

This commit adds the harmonization parameter to the function call,
so the harmonization is loaded from the internal python memory
allocated space & no more file read/write has to be done.

Fixes #2098

Signed-off-by: Sebastian Waldbauer <[email protected]>
  • Loading branch information
waldbauer-certat authored and Wagner committed Sep 9, 2021
1 parent 7363e5a commit 644b3c5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@
CHANGELOG
==========

3.0.2 (2021-09-09)
------------------

### Configuration

### Core
- `intelmq.lib.bot.CollectorBot`: Fixed an issue with within the `new_report` function, which re-loads the harmonization file after a new incoming dataset, which leads to cpu drain and decreased performance (PR#2106 by Sebastian Sebastian, fixes #2098).

### Bots
#### Collectors

#### Parsers

#### Experts

#### Outputs

### Documentation

### Packaging

### Tests

### Tools

### Known issues


3.0.1 (2021-09-02)
------------------

Expand Down
2 changes: 1 addition & 1 deletion intelmq/lib/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ def send_message(self, *messages, path: str = "_default", auto_add: bool = True)
super().send_message(*messages, path=path)

def new_report(self):
return libmessage.Report()
return libmessage.Report(harmonization=self.harmonization)


class SQLBot(Bot):
Expand Down

0 comments on commit 644b3c5

Please sign in to comment.