Skip to content

Commit

Permalink
fix: query all token collection caused oom (#2215)
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid authored Oct 8, 2024
1 parent 8d75712 commit 018cd2b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class UpdateH24CkbTransactionsCountOnCollectionsWorker
sidekiq_options queue: "low"

def perform
TokenCollection.find_each do |collection|
collection.update_h24_ckb_transactions_count
TokenItem.joins(:collection).includes(:collection).where("token_items.updated_at > ?", 1.hour.ago).each do |item|
item.collection.update_h24_ckb_transactions_count
end
end
end

0 comments on commit 018cd2b

Please sign in to comment.