Skip to content

Commit 7496f75

Browse files
committed
chore: tweak default polling interval
1 parent 32f3033 commit 7496f75

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/clients/createClient.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,12 @@ export function createClient(parameters: ClientConfig): Client {
224224
} = parameters
225225

226226
const blockTime = chain?.blockTime ?? 12_000
227-
const pollingInterval =
228-
parameters.pollingInterval ?? Math.floor(blockTime / 3)
227+
228+
const defaultPollingInterval = Math.min(
229+
Math.max(Math.floor(blockTime / 2), 500),
230+
4_000,
231+
)
232+
const pollingInterval = parameters.pollingInterval ?? defaultPollingInterval
229233
const cacheTime = parameters.cacheTime ?? pollingInterval
230234

231235
const account = parameters.account

0 commit comments

Comments
 (0)