Commit f4c89307 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

ensure space is still ok when subtasks are about to start

parent 278396c9
......@@ -45,6 +45,10 @@ spec:
value: {{ printf "%s-rabbitmq" .Release.Name }}
- name: RABBITMQ_PORT
value: '5672'
{{- if .Values.projects.minSizeToKeepFree }}
- name: MIN_SIZE_TO_KEEP_IN_PROJECTS_DIR_IN_MB
value: '{{ .Values.projects.minSizeToKeepFree }}'
{{- end }}
command:
- "celery"
- "-A"
......
......@@ -38,6 +38,11 @@ flask_app = Flask(__name__)
celery = make_celery(flask_app)
@celery.task
def ensure_space_in_project_dir_task(project_id):
ensure_space_in_project_dir(except_project_id=project_id)
@celery.task
def create_project_worktable(project_id):
project = GlobalProject.load(project_id)
......@@ -84,6 +89,9 @@ def run_project_analysis_if_needed(project):
return
tasks = []
post_worktable_tasks = []
tasks.append(ensure_space_in_project_dir_task.si(project.id))
if not os.path.exists(project.get_worktable_path()):
tasks.append(create_project_worktable.si(project.id))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment