From 301bad4f840d69e029b331af139c6abbed832207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lewandowski?= Date: Wed, 2 Aug 2023 10:30:38 +0200 Subject: [PATCH 1/2] feat: update db conditions in check transaction task --- definitions.go | 1 + model_transactions.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/definitions.go b/definitions.go index cf14d179..5102def8 100644 --- a/definitions.go +++ b/definitions.go @@ -110,6 +110,7 @@ const ( xPubIDField = "xpub_id" xPubMetadataField = "xpub_metadata" blockHeightField = "block_height" + blockHashField = "block_hash" // Universal statuses statusCanceled = "canceled" diff --git a/model_transactions.go b/model_transactions.go index 1bbfe69d..8094ea08 100644 --- a/model_transactions.go +++ b/model_transactions.go @@ -950,7 +950,11 @@ func processTransactions(ctx context.Context, maxTransactions int, opts ...Model } conditions := map[string]interface{}{ - blockHeightField: 0, + "$or": []map[string]interface{}{{ + blockHeightField: 0, + }, { + blockHeightField: nil, + }}, } records := make([]Transaction, 0) From 9bbd8f48f24006b6d5e9740fc33d6d761a21cb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lewandowski?= Date: Wed, 2 Aug 2023 11:02:33 +0200 Subject: [PATCH 2/2] chore: increase max number of transactions to check in task --- tasks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.go b/tasks.go index 56e8fd27..dd771f4a 100644 --- a/tasks.go +++ b/tasks.go @@ -108,5 +108,5 @@ func taskCheckTransactions(ctx context.Context, logClient zLogger.GormLoggerInte logClient.Info(ctx, "running check transaction(s) task...") - return processTransactions(ctx, 10, opts...) + return processTransactions(ctx, 1000, opts...) }