From cd83dace6c2f4726225b2deb921c25809b0b7975 Mon Sep 17 00:00:00 2001 From: Rabbit Date: Mon, 30 Dec 2024 15:45:29 +0800 Subject: [PATCH] chore: update bitcoin statistics log --- app/workers/generate_bitcoin_statistic_worker.rb | 4 ++-- .../20241229070841_add_network_to_bitcoin_statistics.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/workers/generate_bitcoin_statistic_worker.rb b/app/workers/generate_bitcoin_statistic_worker.rb index 8843a7745..37b41e7fe 100644 --- a/app/workers/generate_bitcoin_statistic_worker.rb +++ b/app/workers/generate_bitcoin_statistic_worker.rb @@ -15,7 +15,7 @@ def perform BitcoinStatistic.upsert_all(statistic_attributes, unique_by: %i[timestamp network]) rescue StandardError => e - Rails.logger.error "Error occurred during GenerateRgbppHourlyStatistic error: #{e.message}" + Rails.logger.error "Error occurred during GenerateBitcoinStatisticWorker error: #{e.message}" end private @@ -47,7 +47,7 @@ def ckb_attributes(start_time, end_time) transactions_count = ft_transaction_ids.length + dob_transaction_ids.length timestamp = end_time.utc.to_i * 1000 - { timestamp:, transactions_count:, network: :ckb } + { timestamp:, addresses_count: 0, transactions_count:, network: :ckb } end def time_range diff --git a/db/migrate/20241229070841_add_network_to_bitcoin_statistics.rb b/db/migrate/20241229070841_add_network_to_bitcoin_statistics.rb index 8016bd52d..00b293ff2 100644 --- a/db/migrate/20241229070841_add_network_to_bitcoin_statistics.rb +++ b/db/migrate/20241229070841_add_network_to_bitcoin_statistics.rb @@ -1,6 +1,6 @@ class AddNetworkToBitcoinStatistics < ActiveRecord::Migration[7.0] def change - add_column :bitcoin_statistics, :network, :integer, default: :btc + add_column :bitcoin_statistics, :network, :integer remove_index :bitcoin_statistics, :timestamp add_index :bitcoin_statistics, %i[timestamp network], unique: true end