mirror of https://github.com/searx/searx
[enh] add "inactive" attribute to engines
This modification allows us to deactivate engines in settings.yml without commenting them out
This commit is contained in:
parent
80331cc8e6
commit
1794f6a4d3
|
@ -94,6 +94,8 @@ def load_engine(engine_data):
|
||||||
logger.debug('Starting background initialization of %s engine', engine_data['name'])
|
logger.debug('Starting background initialization of %s engine', engine_data['name'])
|
||||||
threading.Thread(target=engine_init).start()
|
threading.Thread(target=engine_init).start()
|
||||||
continue
|
continue
|
||||||
|
if engine_attr == 'inactive' and getattr(engine, engine_attr) is True:
|
||||||
|
return None
|
||||||
if getattr(engine, engine_attr) is None:
|
if getattr(engine, engine_attr) is None:
|
||||||
logger.error('Missing engine config attribute: "{0}.{1}"'
|
logger.error('Missing engine config attribute: "{0}.{1}"'
|
||||||
.format(engine.name, engine_attr))
|
.format(engine.name, engine_attr))
|
||||||
|
|
Loading…
Reference in New Issue