Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Handle exceptions during migration #61

Merged
merged 3 commits into from
May 17, 2018

Conversation

stevegrunwell
Copy link
Contributor

This PR leverages the "woocommerce_caught_exception" action to ensure that any exceptions that are raised during the execution of WooCommerce functions (such as wc_get_order()) are escalated and logged accordingly by WP-CLI.

Additionally, this PR lowers the default batch size for migrate/backfill from 1000 to 100, which results in more frequent database queries but a lower memory footprint, which will be important for less-powerful servers (such as in #49).

Fixes #56.

…d logged) and instead extract information from them when running the CLI migration command
…c method

By default, any public, non-static methods on a WP-CLI command class will be picked up by WP-CLI as an available subcommand, which is less-than-desireable. Unfortunately, the WP plugin API requires that callbacks be public, so a static method helps prevent it from being treated as a valid subcommand.
@stevegrunwell stevegrunwell added bug cli migration Issues related to the WP-CLI migration script labels May 17, 2018
@stevegrunwell stevegrunwell added this to the Version 1.0.0 milestone May 17, 2018
@stevegrunwell stevegrunwell added this to To do in Version 1.0.0 via automation May 17, 2018
@stevegrunwell stevegrunwell moved this from To do to Review in Version 1.0.0 May 17, 2018
@stevegrunwell
Copy link
Contributor Author

@bswatson As a heads up, the tests against trunk are currently failing the same test as #60, which is awaiting merge in woocommerce/woocommerce#20045.

@bswatson bswatson merged commit cf421a8 into develop May 17, 2018
Version 1.0.0 automation moved this from Review to Done May 17, 2018
@bswatson bswatson deleted the fix/handle-exceptions-within-migration branch May 17, 2018 21:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug cli migration Issues related to the WP-CLI migration script
Projects
Version 1.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants