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

feat: improve downloader retry #558

Merged

Conversation

yinheli
Copy link
Contributor

@yinheli yinheli commented Nov 8, 2024

What does this PR do?

  • Refactored to remove duplicate retry expressions by utilizing the getRetryTime() method.
  • Fixed a typo in the log message.

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If it's an extension or dependency update, make sure adding related extensions in src/global/test-extensions.php.
  • If you changed the behavior of static-php-cli, update docs in ./docs/.
  • If you updated config/xxx.json content, run bin/spc dev:sort-config xxx.

- Refactored to remove duplicate retry expressions by utilizing the getRetryTime() method.
- Fixed a typo in the log message.
@crazywhalecc crazywhalecc added the kind/framework Issues related to CLI app framework label Nov 8, 2024
@@ -567,7 +567,7 @@ public static function curlDown(string $url, string $path, string $method = 'GET
}
if ($retry > 0) {
logger()->notice('Retrying curl download ...');
self::curlDown($url, $path, $method, $used_headers, retry: intval(getenv('SPC_RETRY_TIME') ? getenv('SPC_RETRY_TIME') : 0));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This recursive call doesn't seem right. So I updated.

@crazywhalecc crazywhalecc merged commit 3c4d47d into crazywhalecc:main Nov 9, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/framework Issues related to CLI app framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants