You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lucas Nelaupe edited this page Jan 12, 2018
·
3 revisions
Jobs will only be retried by default, you will have to specify a retry count in JobBuilder.
.retry(limit:.limited(5)) // Limit to 5 retry
.retry(limit:.unlimited) // Retry until cancel
SwiftQueue will invoke your implementation of onRetry with the current error encountered.
If the error is due to a constraint like DeadlineError or TaskAlreadyExist. onError will NOT be called since there is no way for you to retry.
func onRetry(error:Error)->RetryConstraint{if error is RetryAble{
// Retry after a certain delay in Seconds
returnRetryConstraint.delay(0)
// You can also specify an exponential back-off
returnRetryConstraint.exponential(initial:1)}else{
// No retry, onRemoved will be called
returnRetryConstraint.cancel
}}