summaryrefslogtreecommitdiff
path: root/searx/engines/__init__.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-06-01 16:24:31 +0200
committerAlexandre Flament <alex@al-f.net>2021-06-01 16:37:20 +0200
commit8375974dff24623d8cb2790ca66ffb067ea34484 (patch)
tree9272bd20b588f92741ce9a00553460b03ef5ca39 /searx/engines/__init__.py
parent89089370463b8d4c8b766d9ac9b59757e9328296 (diff)
downloadsearxng-8375974dff24623d8cb2790ca66ffb067ea34484.tar.gz
searxng-8375974dff24623d8cb2790ca66ffb067ea34484.zip
[fix] sys.exit(1) when there is duplicate engine name
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r--searx/engines/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
index 70a8ab025..d7defe0b4 100644
--- a/searx/engines/__init__.py
+++ b/searx/engines/__init__.py
@@ -197,11 +197,16 @@ def is_engine_active(engine):
def register_engine(engine):
+ if engine.name in engines:
+ logger.error('Engine config error: ambigious name: {0}'.format(engine.name))
+ sys.exit(1)
engines[engine.name] = engine
+
if engine.shortcut in engine_shortcuts:
logger.error('Engine config error: ambigious shortcut: {0}'.format(engine.shortcut))
sys.exit(1)
engine_shortcuts[engine.shortcut] = engine.name
+
for category_name in engine.categories:
categories.setdefault(category_name, []).append(engine)