mirror of
https://github.com/searxng/searxng.git
synced 2024-11-26 21:01:01 +00:00
[fix] sys.exit(1) when there is duplicate engine name
This commit is contained in:
parent
8908937046
commit
8375974dff
1 changed files with 5 additions and 0 deletions
|
@ -197,11 +197,16 @@ def is_engine_active(engine):
|
||||||
|
|
||||||
|
|
||||||
def register_engine(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
|
engines[engine.name] = engine
|
||||||
|
|
||||||
if engine.shortcut in engine_shortcuts:
|
if engine.shortcut in engine_shortcuts:
|
||||||
logger.error('Engine config error: ambigious shortcut: {0}'.format(engine.shortcut))
|
logger.error('Engine config error: ambigious shortcut: {0}'.format(engine.shortcut))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
engine_shortcuts[engine.shortcut] = engine.name
|
engine_shortcuts[engine.shortcut] = engine.name
|
||||||
|
|
||||||
for category_name in engine.categories:
|
for category_name in engine.categories:
|
||||||
categories.setdefault(category_name, []).append(engine)
|
categories.setdefault(category_name, []).append(engine)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue