mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 21:45:23 +02:00
Market data sync refinements (#2252)
* Exchange rate syncer implementation * Security price syncer * Fix issues with provider API * Add back prod schedule * Add back price and exchange rate syncs to account syncs * Remove unused stock_exchanges table
This commit is contained in:
parent
6917cecf33
commit
6dc1d22672
38 changed files with 1206 additions and 1615 deletions
1020
config/exchanges.yml
1020
config/exchanges.yml
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,13 @@
|
|||
require "sidekiq/web"
|
||||
|
||||
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
|
||||
configured_username = ::Digest::SHA256.hexdigest(ENV.fetch("SIDEKIQ_WEB_USERNAME", "maybe"))
|
||||
configured_password = ::Digest::SHA256.hexdigest(ENV.fetch("SIDEKIQ_WEB_PASSWORD", "maybe"))
|
||||
if Rails.env.production?
|
||||
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
|
||||
configured_username = ::Digest::SHA256.hexdigest(ENV.fetch("SIDEKIQ_WEB_USERNAME", "maybe"))
|
||||
configured_password = ::Digest::SHA256.hexdigest(ENV.fetch("SIDEKIQ_WEB_PASSWORD", "maybe"))
|
||||
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(username), configured_username) &&
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(password), configured_password)
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(username), configured_username) &&
|
||||
ActiveSupport::SecurityUtils.secure_compare(::Digest::SHA256.hexdigest(password), configured_password)
|
||||
end
|
||||
end
|
||||
|
||||
Sidekiq::Cron.configure do |config|
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
sync_market_data:
|
||||
cron: "0 17 * * 1-5" # 5:00 PM EST (1 hour after market close)
|
||||
cron: "0 22 * * 1-5" # 5:00 PM EST / 6:00 PM EDT (NY time)
|
||||
class: "SyncMarketDataJob"
|
||||
queue: "scheduled"
|
||||
description: "Syncs market data daily at 5:00 PM EST (1 hour after market close)"
|
||||
args:
|
||||
mode: "full"
|
||||
clear_cache: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue