Skip to content

Commit

Permalink
AHOC feat (installation): let indexer run
Browse files Browse the repository at this point in the history
making indexer run optional and allowing user to control it, cause on big and
mature installations indexer might take substantial time to run and that might
seriously increase deployment time and also cause some other issues, like
sudden high server load and eventual degradation of service for users.
  • Loading branch information
Anton Boritskiy committed Aug 29, 2019
1 parent 0354348 commit 0a9fc7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,8 @@ magento_queue_consumers_cron_template: "/usr/bin/php {{ magento_app_root }}/bin/
magento_cleanup_old_clones: True
magento_clones_to_keep: 5
magento_clones_cleanup_min_age: "1d"

## Enforces indexer run on every deploy
## by default indexer will run only in case database was created from scratch.
## In case you need to refresh indexes on deploy (e.g. to fill search index) - set this to true.
magento_force_reindex_on_deploy: False
1 change: 1 addition & 0 deletions tasks/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
become: "yes"
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

- name: "Disable maintenance mode"
file:
Expand Down

0 comments on commit 0a9fc7f

Please sign in to comment.