From dd926f20354bb48dcb95b4c2c2340975cf30138a Mon Sep 17 00:00:00 2001 From: flaskfarm Date: Thu, 13 Oct 2022 02:18:07 +0900 Subject: [PATCH] update --- lib/framework/init_main.py | 18 +++++++++++------- lib/framework/init_plugin.py | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/framework/init_main.py b/lib/framework/init_main.py index 57147f5..fa8dd29 100644 --- a/lib/framework/init_main.py +++ b/lib/framework/init_main.py @@ -78,10 +78,10 @@ class Framework: if self.config['use_gevent']: self.socketio = SocketIO(self.app, cors_allowed_origins="*") else: - if self.config['running_type'] == 'termux': - self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='eventlet') - else: - self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='threading') + #if self.config['running_type'] == 'termux': + # self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='eventlet') + #else: + self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='threading') CORS(self.app) Markdown(self.app) @@ -161,9 +161,13 @@ class Framework: #F.logger.info(f"celery running_type: {options}") celery.steps['worker'].add(CustomArgs) except Exception as e: - self.logger.error('CELERY!!!') - self.logger.error(f'Exception:{str(e)}') - self.logger.error(traceback.format_exc()) + if self.config['use_celery']: + self.logger.error('CELERY!!!') + self.logger.error(f'Exception:{str(e)}') + self.logger.error(traceback.format_exc()) + else: + self.logger.info("use_celery = False") + def dummy_func(): pass diff --git a/lib/framework/init_plugin.py b/lib/framework/init_plugin.py index be7d741..e5b2c1f 100644 --- a/lib/framework/init_plugin.py +++ b/lib/framework/init_plugin.py @@ -433,6 +433,8 @@ class PluginManager: if F.config['plugin_update'] != True: return plugins_path = os.path.join(F.config['path_data'], 'plugins') + if os.path.exists(plugins_path) == False: + return tmps = os.listdir(plugins_path) for t in tmps: plugin_path = os.path.join(plugins_path, t)