From ea47002e4695c66891f39533674541edb63c74fc Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Fri, 8 Dec 2023 09:24:21 +0800 Subject: [PATCH] refactor: stop clean pending tx and update rejected tx (#1525) Signed-off-by: Miles Zhang --- app/models/ckb_transaction.rb | 8 -------- lib/scheduler.rb | 10 +++------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/models/ckb_transaction.rb b/app/models/ckb_transaction.rb index 044deb220..a2f63c7eb 100644 --- a/app/models/ckb_transaction.rb +++ b/app/models/ckb_transaction.rb @@ -62,14 +62,6 @@ def self.cached_find(query_key) end end - def self.clean_pending - tx_pending.find_each do |t| - if where(tx_hash: t.tx_hash).where.not(tx_status: :pending).exists? - t.destroy - end - end - end - def self.largest_in_epoch(epoch_number) Rails.cache.fetch(["epoch", epoch_number, "largest_tx"]) do tx = CkbTransaction.where(block: { epoch_number: epoch_number }).order(bytes: :desc).first diff --git a/lib/scheduler.rb b/lib/scheduler.rb index 52c9b9d95..f1147f86f 100644 --- a/lib/scheduler.rb +++ b/lib/scheduler.rb @@ -63,9 +63,9 @@ def call_worker(clz) call_worker AddressUnclaimedCompensationGenerator end -s.every "5m", overlap: false do - call_worker PoolTransactionCheckWorker -end +# s.every "5m", overlap: false do +# call_worker PoolTransactionCheckWorker +# end s.every "1h", overlap: false do call_worker CleanUpWorker @@ -108,10 +108,6 @@ def call_worker(clz) call_worker UpdateH24CkbTransactionsCountOnCollectionsWorker end -s.every "1h", overlap: false do - CkbTransaction.clean_pending -end - s.cron "30 0 * * *" do call_worker Charts::ForkedEventProcessor end