![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/arsham/retry/v2
This library supports Go >= 1.20
by getting github.com/arsham/retry/v2
For older Go versions support use the github.com/arsham/retry
import path!
Retry
calls your function, and if it errors it calls it again with a delay.
Eventually it returns the last error or nil if one call is successful.
l := &retry.Retry{
Attempts: 666,
Delay: time.Millisecond,
}
err := l.Do(func() error {
// do some work.
return nil
})
You can provide multiple functions:
err := l.Do(func() error {
return nil
}, func() error {
return nil
}}
If you want to stop retrying you can return a special error:
err := l.Do(func() error {
if specialCase {
return &retry.StopError{
Err: errors.New("a special stop"),
}
}
return nil
})
The standard behaviour is to delay the amount you set. You can pass any function with this signature to change the delay behaviour:
func(attempt int, delay time.Duration) time.Duration
You can also pass the retry.IncrementalDelay
function that would increase the
delay with a jitter to prevent Thundering
herd.
l := &retry.Retry{
Attempts: 666,
Delay: 10 * time.Millisecond,
Method: retry.IncrementalDelay,
}
err := l.Do(func() error {
if specialCase {
return &retry.StopError{
Err: errors.New("a special stop"),
}
}
return nil
})
Use of this source code is governed by the Apache 2.0 license. License can be found in the LICENSE file.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.