MCPcopy Index your code
hub / github.com/chain/Core / retryDelayMillis

Method retryDelayMillis

sdk/java/src/main/java/com/chain/http/Client.java:455–462  ·  view source on GitHub ↗
(int retryAttempt)

Source from the content-addressed store, hash-verified

453 private static final int RETRY_MAX_DELAY_MILLIS = 15000;
454
455 private static int retryDelayMillis(int retryAttempt) {
456 // Calculate the max delay as base * 2 ^ (retryAttempt - 1).
457 int max = RETRY_BASE_DELAY_MILLIS * (1 << (retryAttempt - 1));
458 max = Math.min(max, RETRY_MAX_DELAY_MILLIS);
459
460 // To incorporate jitter, use a pseudo random delay between [max/2, max] millis.
461 return randomGenerator.nextInt(max / 2) + max / 2 + 1;
462 }
463
464 private static final int[] RETRIABLE_STATUS_CODES = {
465 408, // Request Timeout

Callers 1

postMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected