0

Is it possible to prevent new setup resources (e.g. acme/somemodule/sql/install-0.1.0.php) running during the end user page execution flow in Magento 1.7?

What I plan to do is copy across the new version, and then run n98magerun sys:setup:run as part of our deployment shell script. This mitigates any problems if say some data loading exceeds PHP maximum run time (i.e. large one time data loading or perhaps some WS calls), and prevents some random visitors having multiple second delays on page load, right?

If we can't do that (i.e. disable setup resource running on page load execution flow), then I thought about putting site into _maintenance mode, can someone confirm that then this won't trigger when someone loads the site? And then run n98magerun sys:setup:run and then toggle _mainteance mode back off.

How else can this be handled? I feel mightly uncomfortable with our DDL and data migration being invoked by some random unsuspecting frontend user but I'm admittedly not from a PHP background so perhaps this is all normal?

Also should any install/upgrade scripts be idempotent? i.e. if server crashes, db becomes available, stupidly high max runtime value is exceeded, before completed and core_resources is updated it can be rerun safely. However all and every example Ive found is not idempotent (i.e. no drop statement first etc..) which is very odd.

(new to magento devops)

1
  • Okay so I guess I can override _shouldSkipProcessModulesUpdates to check for presence of http request.. feel eeky though Jul 1 '16 at 14:07
1

Yes it is possible.

These are the two configuration settings needed within app/etc/local.xml to disable the automatic processing of setup resources:

<skip_process_modules_updates>1</skip_process_modules_updates>
<skip_process_modules_updates_ignore_dev_mode>1</skip_process_modules_updates_ignore_dev_mode>

You can then manually trigger the updates using n98-magerun sys:setup:incremental assuming that you have n98-magerun installed/available.

Reference: Inchoo - Taking control over module upgrade process

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.