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

Add an option to add a retry delay #108

Closed
gabaum10 opened this issue Jan 8, 2025 · 1 comment
Closed

Add an option to add a retry delay #108

gabaum10 opened this issue Jan 8, 2025 · 1 comment

Comments

@gabaum10
Copy link

gabaum10 commented Jan 8, 2025

I'm submitting a...

Feature request


[ ] Regression 
[ ] Bug report
[ x ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

The retries fire immediately

Expected behavior

An option to configure an optional delay to the retry

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Sometimes the failure is due to a transient network issue that might not be resolved by immediately retrying the asset.

Environment


Assets-retry version: 0.3.4

 
For Tooling issues:
- Browser version: Chrome - Latest
- Platform:  Mac

Others:

@Nikaple
Copy link
Owner

Nikaple commented Jan 14, 2025

Scripts must be retried simutaneously, as we use document.write to block html parsing. Consider two scripts vendor.js and main.js, and main.js calls function in vendor.js. If vendor.js failed to load and we retry vendor.js after a certain delay, function calls in main.js would result in an error. See: https://github.com/Nikaple/assets-retry/blob/master/src/util.ts#L164

@Nikaple Nikaple closed this as completed Jan 14, 2025
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

No branches or pull requests

2 participants