diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2025-07-09 17:32:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 17:32:10 +0200 |
| commit | 2fe8540903c53e3939c86dad6f7f7c0b3162de0f (patch) | |
| tree | 64f2acede11c732570a64fca37e6e6eee341b1ee /searx/search/processors | |
| parent | f798ddd4922d793d5e6ccb7c4111810d549ff4f4 (diff) | |
[fix] prevent multiple, parallel initializations of tables in the cache DB (#4991)
Depending on the respective runtime behavior, it could happen that the initial
loading of the DB tables in the cache was performed multiple times and in
parallel. The concurrent accesses then led to the `sqlite3.OperationalError:
database is locked` exception as in #4951.
Since this problem depends significantly on the runtimes (e.g., how long it
takes to retrieve the content for a table), this error could not be observed in
all installations.
Closes: https://github.com/searxng/searxng/issues/4951
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/search/processors')
| -rw-r--r-- | searx/search/processors/online_currency.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/search/processors/online_currency.py b/searx/search/processors/online_currency.py index 0d7900616..4a56fd05c 100644 --- a/searx/search/processors/online_currency.py +++ b/searx/search/processors/online_currency.py @@ -24,6 +24,10 @@ class OnlineCurrencyProcessor(OnlineProcessor): engine_type = 'online_currency' + def initialize(self): + CURRENCIES.init() + super().initialize() + def get_params(self, search_query, engine_category): """Returns a set of :ref:`request params <engine request online_currency>` or ``None`` if search query does not match to :py:obj:`parser_re`.""" |