From 3a89dceab79217880625f7af75db0d798cf79488 Mon Sep 17 00:00:00 2001 From: Dmytro Haidashenko <34754799+dhaidashenko@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:03:34 +0200 Subject: [PATCH] use tx in insertLogsWithinTx (#14361) --- .changeset/sixty-cougars-mix.md | 5 +++++ core/chains/evm/logpoller/orm.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/sixty-cougars-mix.md diff --git a/.changeset/sixty-cougars-mix.md b/.changeset/sixty-cougars-mix.md new file mode 100644 index 00000000000..a641ce19762 --- /dev/null +++ b/.changeset/sixty-cougars-mix.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Use tx in insertLogsWithinTx #internal diff --git a/core/chains/evm/logpoller/orm.go b/core/chains/evm/logpoller/orm.go index 5ab7db4eb02..e40fb80f108 100644 --- a/core/chains/evm/logpoller/orm.go +++ b/core/chains/evm/logpoller/orm.go @@ -390,7 +390,7 @@ func (o *DSORM) insertLogsWithinTx(ctx context.Context, logs []Log, tx sqlutil.D (:evm_chain_id, :log_index, :block_hash, :block_number, :block_timestamp, :address, :event_sig, :topics, :tx_hash, :data, NOW()) ON CONFLICT DO NOTHING` - _, err := o.ds.NamedExecContext(ctx, query, logs[start:end]) + _, err := tx.NamedExecContext(ctx, query, logs[start:end]) if err != nil { if pkgerrors.Is(err, context.DeadlineExceeded) && batchInsertSize > 500 { // In case of DB timeouts, try to insert again with a smaller batch upto a limit