Browse Source

[fix] fix engine initialization

Adam Tauber 6 years ago
parent
commit
2f69eaeb2f
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      searx/engines/__init__.py

+ 4
- 4
searx/engines/__init__.py View File

230
 
230
 
231
 def initialize_engines(engine_list):
231
 def initialize_engines(engine_list):
232
     load_engines(engine_list)
232
     load_engines(engine_list)
233
-    for engine in engines.items():
233
+    for engine_name, engine in engines.items():
234
         if hasattr(engine, 'init'):
234
         if hasattr(engine, 'init'):
235
-            init_fn = getattr(engine, engine_attr)
235
+            init_fn = getattr(engine, 'init')
236
 
236
 
237
             def engine_init():
237
             def engine_init():
238
                 init_fn()
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
             threading.Thread(target=engine_init).start()
241
             threading.Thread(target=engine_init).start()