-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: trunk
Are you sure you want to change the base?
Conversation
) { | ||
await getIpcApi().showErrorMessageBox( { | ||
title: __( 'Failed importing site' ), | ||
message: __( 'Import process timed out. Very large import?' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should this message say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is my suggestion: The import process timed out after %d hours, which can occur when processing very large imports. If the issue persists, please contact support.')
@@ -11,7 +11,8 @@ export type MessageName = 'execute'; | |||
export type WpCliResult = ReturnType< typeof executeWPCli >; | |||
export type MessageCanceled = { error: Error; canceled: boolean }; | |||
|
|||
const DEFAULT_RESPONSE_TIMEOUT = 300 * 1000; | |||
const DEFAULT_RESPONSE_TIMEOUT = 5 * 60 * 1000; // 5min | |||
const IMPORT_EXPORT_RESPONSE_TIMEOUT = 24 * 60 * 60 * 1000; // 24hr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should be the timeout we set here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we start with fewer hours? I think 6 hours should be enough for most imports, if not maybe we could remove the timeout from imports. Usually 0 represents infinite in these context.
I wonder if these constants could live in a separate config file that the user can tune for their specific needs.
There was a problem hiding this 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.
phpVersion?: string; | ||
longRunning?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think if we pass the exact timeout to wait as a parameter? That way we could be more precise with the different type of executions.
Instead of having a boolean longRunning, we could have an integer with the timeout ms. By default it would be DEFAULT_RESPONSE_TIMEOUT.
); | ||
|
||
if ( stderr ) { | ||
console.error( `Warning during import of ${ sqlFile }:`, stderr ); | ||
console.error( `Error during import of ${ sqlFile }:`, stderr ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Related issues
Proposed Changes
longRunning: true
toexecuteWpCliCommand()
Testing Instructions
Pre-merge Checklist