summaryrefslogtreecommitdiff
path: root/searx/data
diff options
context:
space:
mode:
Diffstat (limited to 'searx/data')
-rw-r--r--searx/data/currencies.py3
-rw-r--r--searx/data/tracker_patterns.py5
2 files changed, 4 insertions, 4 deletions
diff --git a/searx/data/currencies.py b/searx/data/currencies.py
index 0721037a1..504f43ae5 100644
--- a/searx/data/currencies.py
+++ b/searx/data/currencies.py
@@ -24,8 +24,9 @@ class CurrenciesDB:
def init(self):
if self.cache.properties("currencies loaded") != "OK":
- self.load()
+ # To avoid parallel initializations, the property is set first
self.cache.properties.set("currencies loaded", "OK")
+ self.load()
# F I X M E:
# do we need a maintenance .. rember: database is stored
# in /tmp and will be rebuild during the reboot anyway
diff --git a/searx/data/tracker_patterns.py b/searx/data/tracker_patterns.py
index f269b8395..04776b5a5 100644
--- a/searx/data/tracker_patterns.py
+++ b/searx/data/tracker_patterns.py
@@ -7,7 +7,6 @@ import typing
__all__ = ["TrackerPatternsDB"]
import re
-import pathlib
from collections.abc import Iterator
from urllib.parse import urlparse, urlunparse, parse_qsl, urlencode
@@ -22,7 +21,6 @@ class TrackerPatternsDB:
# pylint: disable=missing-class-docstring
ctx_name = "data_tracker_patterns"
- json_file = pathlib.Path(__file__).parent / "tracker_patterns.json"
CLEAR_LIST_URL = [
# ClearURL rule lists, the first one that responds HTTP 200 is used
@@ -42,8 +40,9 @@ class TrackerPatternsDB:
def init(self):
if self.cache.properties("tracker_patterns loaded") != "OK":
- self.load()
+ # To avoid parallel initializations, the property is set first
self.cache.properties.set("tracker_patterns loaded", "OK")
+ self.load()
# F I X M E:
# do we need a maintenance .. rember: database is stored
# in /tmp and will be rebuild during the reboot anyway