Merge "Fix race condition in compression of static files"

This commit is contained in:
Zuul 2021-02-15 12:38:20 +00:00 committed by Gerrit Code Review
commit 2c2289b09f
2 changed files with 11 additions and 9 deletions

View File

@ -97,14 +97,18 @@
when: item.value.theme_src_archive is defined
notify: Restart apache2
- name: Collect and compress static files
command: "{{ item }}"
- name: Collect static files
command: "{{ horizon_manage }} collectstatic --noinput"
become: yes
become_user: "{{ horizon_system_user_name }}"
changed_when: false
notify: Restart apache2
- name: Compress static files
command: "{{ horizon_manage }} compress --force"
become: yes
become_user: "{{ horizon_system_user_name }}"
changed_when: false
with_items:
- "{{ horizon_manage }} collectstatic --noinput"
- "{{ horizon_manage }} compress --force"
notify: Restart apache2
register: async_compress_static_files
async: 600

View File

@ -87,16 +87,14 @@
# since the original task ran as that user. This task will fail if it is run
# as root because the async status file is within the horizon user's home
# directory, not root's home directory.
- name: Ensure static files are collected and compressed
- name: Ensure static files are compressed
async_status:
jid: "{{ item.ansible_job_id }}"
jid: "{{ async_compress_static_files.ansible_job_id }}"
become: yes
become_user: "{{ horizon_system_user_name }}"
register: async_compress_static_files_check
until: async_compress_static_files_check.finished
retries: 300
with_items:
- "{{ async_compress_static_files.results }}"
tags:
- horizon-config