mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-01 18:30:34 +00:00
Change the APScheduler Logic and try to catch more errors in Daemon
This commit is contained in:
13
config.py
13
config.py
@ -18,6 +18,9 @@ class Config:
|
||||
SESSION_COOKIE_SECURE = \
|
||||
os.environ.get('SESSION_COOKIE_SECURE', 'false').lower() == 'true'
|
||||
|
||||
''' # Flask-APScheduler # '''
|
||||
JOBS = []
|
||||
|
||||
''' # Flask-Assets '''
|
||||
ASSETS_DEBUG = os.environ.get('ASSETS_DEBUG', 'false').lower() == 'true'
|
||||
|
||||
@ -112,6 +115,16 @@ class Config:
|
||||
fmt=app.config['NOPAQUE_LOG_FORMAT'],
|
||||
datefmt=app.config['NOPAQUE_LOG_DATE_FORMAT']
|
||||
)
|
||||
if app.config['NOPAQUE_IS_PRIMARY_INSTANCE']:
|
||||
app.config['JOBS'].append(
|
||||
{
|
||||
"id": "daemon",
|
||||
"func": "app.daemon:daemon",
|
||||
"args": (app,),
|
||||
"trigger": "interval",
|
||||
"seconds": 3,
|
||||
}
|
||||
)
|
||||
if app.config['NOPAQUE_LOG_STDERR_ENABLED']:
|
||||
stream_handler = logging.StreamHandler()
|
||||
stream_handler.setFormatter(formatter)
|
||||
|
Reference in New Issue
Block a user