Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 8ab7940

Browse files
committed
tweak timings
for some reason it was polling every 100ms, which is definitely too much in production
1 parent 01840c3 commit 8ab7940

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/dataunion/DataUnion.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ export class DataUnion {
589589
): Promise<ContractReceipt | AmbMessageHash | null> {
590590
const {
591591
pollingIntervalMs = 1000,
592-
retryTimeoutMs = 60000,
592+
retryTimeoutMs = 300000,
593593
// by default, transport the signatures if freeWithdraw isn't supported by the sidechain
594594
payForTransport = !this.client.options.dataUnion.freeWithdraw,
595595
waitUntilTransportIsComplete = true,
@@ -642,10 +642,14 @@ export class DataUnion {
642642
return ambTr
643643
}
644644

645+
// TODO: this doesn't belong here. Transporting a message is NOT dataunion-specific and needs nothing from DataUnion.ts.
646+
// It shouldn't be required to create a DataUnion object to call this.
647+
// This belongs to the StreamrClient, and if the code is too DU-specific then please shove it back to Contracts.ts.
648+
// Division to transportMessage and Contracts.transportSignaturesForMessage is spurious, they should be one long function probably.
645649
/**
646650
* @returns null if message was already transported, ELSE the mainnet AMB signature execution transaction receipt
647651
*/
648-
async transportMessage(messageHash: AmbMessageHash, pollingIntervalMs?: number, retryTimeoutMs?: number) {
652+
async transportMessage(messageHash: AmbMessageHash, pollingIntervalMs: number = 1000, retryTimeoutMs: number = 300000) {
649653
const helper = this.getContracts()
650654
const sidechainAmb = await helper.getSidechainAmb()
651655
const mainnetAmb = await helper.getMainnetAmb()

0 commit comments

Comments
 (0)