Skip to content

Commit

Permalink
Merge pull request #36 from KyberNetwork/ft/batcher-flush
Browse files Browse the repository at this point in the history
feat: batchable eth client can now be flushed manually
  • Loading branch information
NgoKimPhu authored Aug 21, 2024
2 parents 6041fa3 + 5b38395 commit 54f773c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22
toolchain go1.22.3

require (
github.com/KyberNetwork/kutils v0.3.1
github.com/KyberNetwork/kutils v0.3.2
github.com/KyberNetwork/kyber-trace-go v0.1.2
github.com/bufbuild/protovalidate-go v0.6.4
github.com/cenkalti/backoff/v4 v4.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-2024071716455
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw=
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/KyberNetwork/kutils v0.3.1 h1:0Z3gSd/HxyDdXmgDwoYCTurcUXPDLJgVReuNpOAV4zI=
github.com/KyberNetwork/kutils v0.3.1/go.mod h1:a6mG7UxKANmqzs2FnAe9FzGXQ8fRVxq/PWIrSt+L+uc=
github.com/KyberNetwork/kutils v0.3.2 h1:cBoyP99gSO7+PzCp1/5LLi5rsIw965NxJ9fRvQtlPe0=
github.com/KyberNetwork/kutils v0.3.2/go.mod h1:a6mG7UxKANmqzs2FnAe9FzGXQ8fRVxq/PWIrSt+L+uc=
github.com/KyberNetwork/kyber-trace-go v0.1.2 h1:x82SuCYTj4naoGNQ02DoSQgl7f07grl8RL8cKGAFNLw=
github.com/KyberNetwork/kyber-trace-go v0.1.2/go.mod h1:X6hVacmKMeOEOlFh4TyfEHaEVRerFQ5YLuQ4keRV3hw=
github.com/KyberNetwork/logger v0.1.0 h1:Iibu9Ls+tipjR+C0iXhzUYM1VtRgmmR1HHWGufPYcbs=
Expand Down
6 changes: 6 additions & 0 deletions pkg/client/eth_batchable.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func (b *BatchableEthClient) CallContract(ctx context.Context, msg ethereum.Call
return task.Result()
}

// Flush executes all currently queued requests.
func (b *BatchableEthClient) Flush() {
b.batcher.Flush()
b.archiveBatcher.Flush()
}

func (b *BatchableEthClient) Close() {
b.EthClient.Close()
b.batcher.Close()
Expand Down

0 comments on commit 54f773c

Please sign in to comment.