This commit is contained in:
flaskfarm
2022-10-13 02:18:07 +09:00
parent e599b0c4aa
commit dd926f2035
2 changed files with 13 additions and 7 deletions

View File

@@ -78,10 +78,10 @@ class Framework:
if self.config['use_gevent']: if self.config['use_gevent']:
self.socketio = SocketIO(self.app, cors_allowed_origins="*") self.socketio = SocketIO(self.app, cors_allowed_origins="*")
else: else:
if self.config['running_type'] == 'termux': #if self.config['running_type'] == 'termux':
self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='eventlet') # self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='eventlet')
else: #else:
self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='threading') self.socketio = SocketIO(self.app, cors_allowed_origins="*", async_mode='threading')
CORS(self.app) CORS(self.app)
Markdown(self.app) Markdown(self.app)
@@ -161,9 +161,13 @@ class Framework:
#F.logger.info(f"celery running_type: {options}") #F.logger.info(f"celery running_type: {options}")
celery.steps['worker'].add(CustomArgs) celery.steps['worker'].add(CustomArgs)
except Exception as e: except Exception as e:
self.logger.error('CELERY!!!') if self.config['use_celery']:
self.logger.error(f'Exception:{str(e)}') self.logger.error('CELERY!!!')
self.logger.error(traceback.format_exc()) self.logger.error(f'Exception:{str(e)}')
self.logger.error(traceback.format_exc())
else:
self.logger.info("use_celery = False")
def dummy_func(): def dummy_func():
pass pass

View File

@@ -433,6 +433,8 @@ class PluginManager:
if F.config['plugin_update'] != True: if F.config['plugin_update'] != True:
return return
plugins_path = os.path.join(F.config['path_data'], 'plugins') plugins_path = os.path.join(F.config['path_data'], 'plugins')
if os.path.exists(plugins_path) == False:
return
tmps = os.listdir(plugins_path) tmps = os.listdir(plugins_path)
for t in tmps: for t in tmps:
plugin_path = os.path.join(plugins_path, t) plugin_path = os.path.join(plugins_path, t)