diff --git a/src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py b/src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py index c40f8295936..8e7166e3a40 100644 --- a/src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py +++ b/src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py @@ -36,7 +36,8 @@ def __init__(self, notifier: Notifier, db: TagDatabase, mds: MetadataStore, self.mds = mds self.batch_size = batch_size self.interval = interval - self.notifier.add_observer(notifications.new_torrent_metadata_created, self.process_torrent_title) + self.notifier.add_observer(notifications.new_torrent_metadata_created, self.process_torrent_title, + synchronous=True) @db_session def start(self): diff --git a/src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py b/src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py index 14ce6b140ca..02d082466a7 100644 --- a/src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py +++ b/src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py @@ -23,7 +23,8 @@ def test_constructor(tag_rules_processor: TagRulesProcessor): assert tag_rules_processor.interval == TEST_INTERVAL m: MagicMock = tag_rules_processor.notifier.add_observer - m.assert_called_with(notifications.new_torrent_metadata_created, tag_rules_processor.process_torrent_title) + m.assert_called_with(notifications.new_torrent_metadata_created, tag_rules_processor.process_torrent_title, + synchronous=True) @patch.object(TagRulesProcessor, 'save_tags')