Skip to content

Commit

Permalink
ADHOC feat async-import: control async timeouts
Browse files Browse the repository at this point in the history
there are project where reindex takes way longer than 10 minutes,
those projects should have a possibility to specify a higher timeout.
  • Loading branch information
Anton Boritskiy committed Jun 10, 2021
1 parent 63445e5 commit cae79d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,13 @@ magento_force_reindex_on_deploy: False
# when clones are cleaned up asynchronously, role is not checking successful execution
magento_allow_async_cleanup_old_clones: false

# timeout for async old clones cleanup, seconds
magento_async_cleanup_old_clones_timeout: 600

# allows to run magento reindexing asynchronously,
# this allows pipeline to finish faster due to "parallel" execution of tasks
# when reindexing is done asynchronously, role is not checking successful execution
magento_allow_async_reindex: false
magento_allow_async_reindex: false

# timeout for async reindex execution, seconds
magento_async_reindex_timeout: 600
4 changes: 2 additions & 2 deletions tasks/cleanup-old-clones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
state: absent
when: magento_cleanup_old_clones and magento_allow_async_cleanup_old_clones
with_items: "{{ (magento_clones_for_cleanup.files | sort(attribute='ctime', reverse=True))[magento_clones_to_keep:] | list }}"
async: 600
async: "{{ magento_async_cleanup_old_clones_timeout }}"
poll: 0

- name: "Remove old clones/releases synchronously"
file:
path: "{{ item.path }}"
state: absent
when: magento_cleanup_old_clones and (not magento_allow_async_cleanup_old_clones)
with_items: "{{ (magento_clones_for_cleanup.files | sort(attribute='ctime', reverse=True))[magento_clones_to_keep:] | list }}"
with_items: "{{ (magento_clones_for_cleanup.files | sort(attribute='ctime', reverse=True))[magento_clones_to_keep:] | list }}"
2 changes: 1 addition & 1 deletion tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
become_user: "{{ magento_user }}"
command: "/usr/bin/php {{ magento_app_root }}/bin/magento indexer:reindex"
when: (magento_db_status.stdout_lines|length == 0 or magento_force_reindex_on_deploy == True) and magento_allow_async_reindex
async: 600
async: "{{ magento_async_reindex_timeout }}"
poll: 0

- name: "Let Magento indexer run synchronously"
Expand Down

0 comments on commit cae79d1

Please sign in to comment.