Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: stop clean pending tx and update rejected tx #1525

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions app/models/ckb_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions lib/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down