Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set higher timeouts for import/export wp-cli commands #904

Merged
merged 7 commits into from
Feb 17, 2025

Conversation

ashfame
Copy link
Member

@ashfame ashfame commented Feb 6, 2025

Related issues

Proposed Changes

  • Default timeout of 5mins for waiting on wp-cli command to finish is too small for big imports. In this PR, I have added a higher timeout for import/export commands, which gets used by passing an arg longRunning: true to executeWpCliCommand()
  • Show a custom error message when it does timeout (currently set to 24hrs)
Screenshot 2025-02-06 at 22 13 40

Testing Instructions

  • I tested it by lowering the default timeout to small like 5 secs and process a normal backup file, it fails as per the linked issue
  • Then on this branch, keep the default timeout lowered and see it uses the higher timeout set for import/export and finishes up.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Sorry, something went wrong.

@ashfame ashfame self-assigned this Feb 6, 2025
@ashfame ashfame marked this pull request as ready for review February 7, 2025 08:46
@ashfame ashfame requested a review from a team February 7, 2025 08:46
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good. Increasing the import process will allow users to import websites with more content.

To establish reasonable limits, we might need to benchmark the amount of content imported on a typical computer and set a limit based on those metrics.

I’ve added a couple of suggestions, please let me know what you think.

@ashfame ashfame force-pushed the wp_cli_higher_timeout_import_export branch from b82e923 to b427255 Compare February 17, 2025 10:49
@ashfame ashfame requested a review from sejas February 17, 2025 10:59
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashfame, Thanks for considering my suggestions. I like the new approach where wp-cli-process handles selecting the timeout based on the command.

I've tested it and confirmed that the timeout for SQLite export and import processes is 6 hours, while the rest of wp-cli commands still 5 minutes.

Screenshot 2025-02-17 at 15 35 46

I've left a couple of non-blocking comments.

ashfame and others added 2 commits February 17, 2025 21:09

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Antonio Sejas <[email protected]>
@ashfame
Copy link
Member Author

ashfame commented Feb 17, 2025

@sejas Thanks for the review! I made both the changes. Will merge shortly 👍

@ashfame ashfame merged commit 9e369b5 into trunk Feb 17, 2025
7 checks passed
@ashfame ashfame deleted the wp_cli_higher_timeout_import_export branch February 17, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants