Skip to content

Commit 213a8c4

Browse files
authored
Merge pull request #2425 from nervosnetwork/testnet
Deploy to mainnet
2 parents 3aa7f39 + e4655dd commit 213a8c4

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

app/controllers/api/v1/market_data_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ class MarketDataController < ApplicationController
44
skip_before_action :check_header_info
55

66
def index
7+
expires_in 30.minutes, public: true, stale_while_revalidate: 10.minutes, stale_if_error: 10.minutes
78
render json: MarketData.new.indicators_json
89
end
910

1011
def show
12+
expires_in 30.minutes, public: true, stale_while_revalidate: 10.minutes, stale_if_error: 10.minutes
1113
render json: MarketData.new(indicator: params[:id]).call
1214
end
1315
end

app/controllers/api/v2/fiber/graph_nodes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def show
2828

2929
def addresses
3030
nodes = FiberGraphNode.all.select(:node_id, :addresses)
31-
render json: { data: nodes.map { _1.attributes.except("id") } }
31+
render json: { data: nodes.map { { node_id: _1.node_id, addresses: _1.addresses, connections: _1.connected_node_ids } } }
3232
end
3333
end
3434
end

app/models/market_data.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ def total_supply
9797

9898
def unmade_dao_interests
9999
@unmade_dao_interests ||=
100-
begin
101-
tip_dao = tip_block.dao
102-
total = 0
103-
CellOutput.nervos_dao_deposit.
104-
generated_before(tip_block.timestamp).unconsumed_at(tip_block.timestamp).find_each do |cell_output|
105-
total += DaoCompensationCalculator.new(cell_output, tip_dao).call
106-
end
107-
total
100+
Rails.cache.fetch("unmade_dao_interests", expires_in: 1.day) do
101+
# tip_dao = tip_block.dao
102+
# total = 0
103+
# CellOutput.nervos_dao_deposit.generated_before(tip_block.timestamp).unconsumed_at(tip_block.timestamp).find_each do |cell_output|
104+
# total += DaoCompensationCalculator.new(cell_output, tip_dao).call
105+
# end
106+
# total
107+
0
108108
end
109109
end
110110

0 commit comments

Comments
 (0)