Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <mingchang555@hotmail.com>
  • Loading branch information
zmcNotafraid committed Jan 28, 2025
2 parents c2febb3 + cbed631 commit 63317b0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
14 changes: 7 additions & 7 deletions app/controllers/api/v1/blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ def index
order_by, asc_or_desc = params[:sort].split(".", 2)
order_by =
case order_by
when "height"
"number"
when "transactions"
"ckb_transactions_count"
else
order_by
when "height"
"number"
when "transactions"
"ckb_transactions_count"
else
order_by
end

head :not_found and return unless order_by.in? %w[number reward timestamp ckb_transactions_count]

blocks = blocks.order(order_by => asc_or_desc).page(@page).per(@page_size)
blocks = blocks.order(order_by => asc_or_desc).order("number DESC").page(@page).per(@page_size)

json =
Rails.cache.realize(blocks.cache_key, version: blocks.cache_version, race_condition_ttl: 3.seconds) do
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/omiga_inscriptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def sort_udts(records)
if sort == "mint_status"
records.joins(:omiga_inscription_info).order("omiga_inscription_infos.mint_status #{order}")
else
records.order("#{sort} #{order}")
records.order("#{sort} #{order}").order("full_name ASC, id ASC")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/udts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def sort_udts(records)
order = "asc"
end

records.order("#{sort} #{order}")
records.order("#{sort} #{order}").order("full_name ASC, id ASC")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/xudts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def sort_udts(records)
order = "asc"
end

records.order("#{sort} #{order}")
records.order("#{sort} #{order}").order("full_name ASC, id ASC")
end

def parse_tags
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/api/v2/pending_transactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def index
where.not(previous_cell_output_id: nil, from_cell_base: false).
pluck(:ckb_transaction_id).uniq
pending_transactions = CkbTransaction.where(id: unique_tx_ids).
order(transactions_ordering).page(@page).per(@page_size)
order(transactions_ordering).order("id DESC").page(@page).per(@page_size)

json = {
data: pending_transactions.map do |tx|
Expand All @@ -20,21 +20,21 @@ def index
capacity_involved: tx.capacity_involved,
transaction_fee: tx.transaction_fee,
created_at: tx.created_at,
create_timestamp: (tx.created_at.to_f * 1000).to_i
create_timestamp: (tx.created_at.to_f * 1000).to_i,
}
end,
meta: {
total: pending_transactions.total_count,
page_size: @page_size.to_i
}
page_size: @page_size.to_i,
},
}

render json: json
end

def count
render json: {
data: CkbTransaction.tx_pending.count
data: CkbTransaction.tx_pending.count,
}
end

Expand Down
2 changes: 0 additions & 2 deletions app/services/charts/daily_statistic_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ def call
daily_statistic.from_scratch = from_scratch
daily_statistic.reset!(updated_attrs)
daily_statistic
rescue StandardError => e
Rails.logger.error "Error occurred during DailyStatisticGenerator error: #{e.message}"
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/workers/charts/daily_statistic.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Charts
class DailyStatistic
include Sidekiq::Worker
sidekiq_options queue: "critical", backtrace: 20
sidekiq_options queue: "critical"

# iterate from the creation timestamp of last daily statistic record to now day by day
# and generate daily statistic record for each day
Expand Down
2 changes: 1 addition & 1 deletion lib/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def call_worker(clz)
call_worker AnalyzeContractFromCellDependencyWorker
end

s.every "0 */4 * * *", overlap: false do
s.cron "0 */4 * * *", overlap: false do
call_worker FiberGraphDetectWorker
end

Expand Down

0 comments on commit 63317b0

Please sign in to comment.