瀏覽代碼

[fix] fix engine initialization

Adam Tauber 6 年之前
父節點
當前提交
2f69eaeb2f
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4
    4
      searx/engines/__init__.py

+ 4
- 4
searx/engines/__init__.py 查看文件

@@ -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()