Merge remote-tracking branch 'origin/dev' into waiting-workflow-errors-566

This commit is contained in:
Dan 2021-12-13 13:05:02 -05:00
commit ad9a480f93
2 changed files with 8 additions and 4 deletions

View File

@ -56,15 +56,18 @@ from crc.services.file_service import FileService
from crc.services.workflow_service import WorkflowService
connexion_app.add_api('api.yml', base_path='/v1.0')
# needed function to avoid circular import
# needed function to avoid circular import
def process_waiting_tasks():
with app.app_context():
WorkflowService.do_waiting()
scheduler.add_job(process_waiting_tasks,'interval',minutes=1)
scheduler.add_job(FileService.cleanup_file_data, 'interval', minutes=1440) # once a day
scheduler.start()
@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()
# Convert list of allowed origins to list of regexes

View File

@ -266,6 +266,7 @@ class StudySchema(ma.Schema):
warnings = fields.List(fields.Nested(ApiErrorSchema), dump_only=True)
protocol_builder_status = EnumField(StudyStatus, by_value=True)
status = EnumField(StudyStatus, by_value=True)
progress_status = EnumField(ProgressStatus, by_value=True, allow_none=True)
short_title = fields.String(allow_none=True)
sponsor = fields.String(allow_none=True)
ind_number = fields.String(allow_none=True)