mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
Rename app/sidekiq to app/jobs
This commit is contained in:
parent
1e1c9c2481
commit
a7667ba29a
14 changed files with 27 additions and 41 deletions
|
@ -1,5 +1,4 @@
|
||||||
class AskQuestionJob
|
class AskQuestionJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(conversation_id, reply_id)
|
def perform(conversation_id, reply_id)
|
||||||
conversation = Conversation.find(conversation_id)
|
conversation = Conversation.find(conversation_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class EnrichTransactionsJob
|
class EnrichTransactionsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
enrichment = Faraday.new(
|
enrichment = Faraday.new(
|
|
@ -1,5 +1,4 @@
|
||||||
class GenerateBalanceJob
|
class GenerateBalanceJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(account_id)
|
def perform(account_id)
|
||||||
account = Account.find(account_id)
|
account = Account.find(account_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class GenerateCategoricalMetricsJob
|
class GenerateCategoricalMetricsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(family_id)
|
def perform(family_id)
|
||||||
family = Family.find(family_id)
|
family = Family.find(family_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class GenerateMetricsJob
|
class GenerateMetricsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(family_id)
|
def perform(family_id)
|
||||||
family = Family.find(family_id)
|
family = Family.find(family_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class RealTimeSyncJob
|
class RealTimeSyncJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(security_id)
|
def perform(security_id)
|
||||||
security = Security.find(security_id)
|
security = Security.find(security_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncPlaidHoldingsJob
|
class SyncPlaidHoldingsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(item_id)
|
def perform(item_id)
|
||||||
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
||||||
|
@ -74,6 +73,6 @@ class SyncPlaidHoldingsJob
|
||||||
|
|
||||||
Holding.upsert_all(all_holdings, unique_by: :index_holdings_on_account_id_and_security_id)
|
Holding.upsert_all(all_holdings, unique_by: :index_holdings_on_account_id_and_security_id)
|
||||||
|
|
||||||
SyncPlaidInvestmentTransactionsJob.perform_async(item_id)
|
SyncPlaidInvestmentTransactionsJob.perform(item_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,7 +1,6 @@
|
||||||
class SyncPlaidInstitutionsJob
|
class SyncPlaidInstitutionsJob < ApplicationJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform
|
def perform_now
|
||||||
# Get all institutions from Plaid, which includes paginating through all pages
|
# Get all institutions from Plaid, which includes paginating through all pages
|
||||||
offset = 0
|
offset = 0
|
||||||
while true
|
while true
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncPlaidInvestmentTransactionsJob
|
class SyncPlaidInvestmentTransactionsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(item_id)
|
def perform(item_id)
|
||||||
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
||||||
|
@ -120,7 +119,7 @@ class SyncPlaidInvestmentTransactionsJob
|
||||||
end
|
end
|
||||||
|
|
||||||
accounts.each do |account|
|
accounts.each do |account|
|
||||||
GenerateBalanceJob.perform_async(account.id)
|
GenerateBalanceJob.perform(account.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncPlaidItemAccountsJob
|
class SyncPlaidItemAccountsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(item_id)
|
def perform(item_id)
|
||||||
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
||||||
|
@ -38,12 +37,12 @@ class SyncPlaidItemAccountsJob
|
||||||
)
|
)
|
||||||
connection_account.save
|
connection_account.save
|
||||||
|
|
||||||
#GenerateBalanceJob.perform_async(connection_account.id)
|
#GenerateBalanceJob.perform(connection_account.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
connection.update(sync_status: 'idle')
|
connection.update(sync_status: 'idle')
|
||||||
|
|
||||||
SyncPlaidTransactionsJob.perform_async(item_id)
|
SyncPlaidTransactionsJob.perform(item_id)
|
||||||
SyncPlaidHoldingsJob.perform_async(item_id)
|
SyncPlaidHoldingsJob.perform(item_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncPlaidTransactionsJob
|
class SyncPlaidTransactionsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(item_id)
|
def perform(item_id)
|
||||||
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
||||||
|
@ -92,10 +91,10 @@ class SyncPlaidTransactionsJob
|
||||||
Transaction.where(source_transaction_id: removed_transactions).destroy_all
|
Transaction.where(source_transaction_id: removed_transactions).destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
EnrichTransactionsJob.perform_async
|
EnrichTransactionsJob.perform
|
||||||
|
|
||||||
accounts.each do |account|
|
accounts.each do |account|
|
||||||
GenerateBalanceJob.perform_async(account.id)
|
GenerateBalanceJob.perform(account.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncPropertyValuesJob
|
class SyncPropertyValuesJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(account_id)
|
def perform(account_id)
|
||||||
account = Account.find(account_id)
|
account = Account.find(account_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncSecurityDetailsJob
|
class SyncSecurityDetailsJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(security_id)
|
def perform(security_id)
|
||||||
security = Security.find_by(id: security_id)
|
security = Security.find_by(id: security_id)
|
|
@ -1,5 +1,4 @@
|
||||||
class SyncSecurityHistoryJob
|
class SyncSecurityHistoryJob
|
||||||
include Sidekiq::Job
|
|
||||||
|
|
||||||
def perform(security_id)
|
def perform(security_id)
|
||||||
security = Security.find(security_id)
|
security = Security.find(security_id)
|
Loading…
Add table
Add a link
Reference in a new issue