Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
module Workers
module AMQP
class InfluxWriter < Base
def process(payload, metadata, _delivery_info)
case metadata[:headers]['type']
when 'local'
trade = Trade.new payload
trade.write_to_influx
when 'upstream'
trade = Trade.new payload.merge(total: payload['price'].to_d * payload['amount'].to_d)
trade.write_to_influx
end
end
end
end
end