Skip to content

Commit 4e9e51a

Browse files
committed
Reduce retry delay calculation in custom GQL fetch
1 parent 27d698e commit 4e9e51a

File tree

2 files changed

+2
-3
lines changed
  • packages/sdk
    • python/human-protocol-sdk/human_protocol_sdk
    • typescript/human-protocol-sdk/src

2 files changed

+2
-3
lines changed

packages/sdk/python/human-protocol-sdk/human_protocol_sdk/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def custom_gql_fetch(
108108
if not is_indexer_error(error):
109109
break
110110

111-
delay = base_delay * (2**attempt)
111+
delay = base_delay * attempt
112112
time.sleep(delay)
113113

114114
raise last_error

packages/sdk/typescript/human-protocol-sdk/src/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ export const customGqlFetch = async <T = any>(
151151
throw error;
152152
}
153153

154-
const delay = baseDelay * Math.pow(2, attempt);
155-
154+
const delay = baseDelay * attempt;
156155
await sleep(delay);
157156
}
158157
}

0 commit comments

Comments
 (0)