mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
* Use Redis for ActiveJob and ActionCable * Fix alwaysApply setting * Update queue names and weights * Tweak weights * Update job queues * Update docker setup guide * Remove deprecated upgrade columns from users table * Refactor Redis configuration for Sidekiq and caching in production environment * Add Sidekiq Sentry monitoring * queue naming fix * Clean up schema
21 lines
590 B
Ruby
21 lines
590 B
Ruby
class FetchSecurityInfoJob < ApplicationJob
|
|
queue_as :low_priority
|
|
|
|
def perform(security_id)
|
|
return unless Security.provider.present?
|
|
|
|
security = Security.find(security_id)
|
|
|
|
params = {
|
|
ticker: security.ticker
|
|
}
|
|
params[:mic_code] = security.exchange_mic if security.exchange_mic.present?
|
|
params[:operating_mic] = security.exchange_operating_mic if security.exchange_operating_mic.present?
|
|
|
|
security_info_response = Security.provider.fetch_security_info(**params)
|
|
|
|
security.update(
|
|
name: security_info_response.info.dig("name")
|
|
)
|
|
end
|
|
end
|