Skip to content

Commit

Permalink
chore: catch import transaction error (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitz committed Jul 28, 2023
1 parent 4418752 commit dbadfcb
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/websocket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ def subscribe(connection, topic)
loop do
data = queue.pop

ImportTransactionJob.new.perform(data["transaction"], {
cycles: data["cycles"].hex,
fee: data["fee"].hex,
size: data["size"].hex,
timestamp: data["timestamp"].hex
})
begin
ImportTransactionJob.new.perform(data["transaction"], {
cycles: data["cycles"].hex,
fee: data["fee"].hex,
size: data["size"].hex,
timestamp: data["timestamp"].hex
})
rescue StandardError => e
Rails.logger.error "Error occurred during ImportTransactionJob data: #{data}, error: #{e.message}"
end
end
end
end
Expand Down

0 comments on commit dbadfcb

Please sign in to comment.