Ver código fonte

[fix] fix engine initialization

Adam Tauber 6 anos atrás
pai
commit
2f69eaeb2f
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4
    4
      searx/engines/__init__.py

+ 4
- 4
searx/engines/__init__.py Ver arquivo

@@ -230,12 +230,12 @@ def load_engines(engine_list):
230 230
 
231 231
 def initialize_engines(engine_list):
232 232
     load_engines(engine_list)
233
-    for engine in engines.items():
233
+    for engine_name, engine in engines.items():
234 234
         if hasattr(engine, 'init'):
235
-            init_fn = getattr(engine, engine_attr)
235
+            init_fn = getattr(engine, 'init')
236 236
 
237 237
             def engine_init():
238 238
                 init_fn()
239
-                logger.debug('%s engine initialized', engine_data['name'])
240
-            logger.debug('Starting background initialization of %s engine', engine_data['name'])
239
+                logger.debug('%s engine initialized', engine_name)
240
+            logger.debug('Starting background initialization of %s engine', engine_name)
241 241
             threading.Thread(target=engine_init).start()