Merge pull request #455 from sartography/feature/disable_scheduled_tasks_in_config

Disable Scheduled Tasks in Development Mode (if desired).
This commit is contained in:
Mike Cullerton 2022-02-15 16:13:06 -05:00 committed by GitHub
commit 4615fcbae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -98,3 +98,6 @@ MAIL_PASSWORD = environ.get('MAIL_PASSWORD', default='')
# Local file path
SYNC_FILE_ROOT = environ.get('SYNC_FILE_ROOT', default='tests/data/IMPORT_TEST')
# Turn on/off processing waiting tasks
PROCESS_WAITING_TASKS = environ.get('PROCESS_WAITING_TASKS', default='true')

View File

@ -65,9 +65,9 @@ def process_waiting_tasks():
@app.before_first_request
def init_scheduler():
scheduler.add_job(process_waiting_tasks, 'interval', minutes=1)
# scheduler.add_job(FileService.cleanup_file_data, 'interval', minutes=1440) # once a day
scheduler.start()
if app.config['PROCESS_WAITING_TASKS']:
scheduler.add_job(process_waiting_tasks, 'interval', minutes=1)
scheduler.start()
# Convert list of allowed origins to list of regexes