Skip to content

Commit

Permalink
Skip check queue size in test
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Dec 13, 2018
1 parent 3e6e43b commit e5e97fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/cita_sync/persist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def save_blocks_with_infos
# current biggest block number in database
last_block_number = SyncInfo.current_block_number || -1
((last_block_number + 1)..block_number).each do |num|
break if event_loop_queue.size >= 100 || default_queue.size >= 500
break if !Rails.env.test? && (event_loop_queue.size >= 100 || default_queue.size >= 500)

hex_str = HexUtils.to_hex(num)
SaveBlockWorker.perform_async(hex_str)
Expand Down
1 change: 1 addition & 0 deletions spec/models/cita_sync/persist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def set_false
it "save blocks with transactions with exist block" do
Sidekiq::Worker.clear_all
CitaSync::Persist.save_block("0x0")
SyncInfo.current_block_number = 0
CitaSync::Persist.save_blocks_with_infos
Sidekiq::Worker.drain_all
expect(Block.count).to eq 2
Expand Down

0 comments on commit e5e97fa

Please sign in to comment.