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
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(conversation_id, reply_id)
|
||||
conversation = Conversation.find(conversation_id)
|
|
@ -1,5 +1,4 @@
|
|||
class EnrichTransactionsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform
|
||||
enrichment = Faraday.new(
|
|
@ -1,5 +1,4 @@
|
|||
class GenerateBalanceJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(account_id)
|
||||
account = Account.find(account_id)
|
|
@ -1,5 +1,4 @@
|
|||
class GenerateCategoricalMetricsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(family_id)
|
||||
family = Family.find(family_id)
|
|
@ -1,5 +1,4 @@
|
|||
class GenerateMetricsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(family_id)
|
||||
family = Family.find(family_id)
|
|
@ -1,5 +1,4 @@
|
|||
class RealTimeSyncJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(security_id)
|
||||
security = Security.find(security_id)
|
|
@ -1,5 +1,4 @@
|
|||
class SyncPlaidHoldingsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(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)
|
||||
|
||||
SyncPlaidInvestmentTransactionsJob.perform_async(item_id)
|
||||
SyncPlaidInvestmentTransactionsJob.perform(item_id)
|
||||
end
|
||||
end
|
|
@ -1,7 +1,6 @@
|
|||
class SyncPlaidInstitutionsJob
|
||||
include Sidekiq::Job
|
||||
class SyncPlaidInstitutionsJob < ApplicationJob
|
||||
|
||||
def perform
|
||||
def perform_now
|
||||
# Get all institutions from Plaid, which includes paginating through all pages
|
||||
offset = 0
|
||||
while true
|
|
@ -1,5 +1,4 @@
|
|||
class SyncPlaidInvestmentTransactionsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(item_id)
|
||||
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
||||
|
@ -120,7 +119,7 @@ class SyncPlaidInvestmentTransactionsJob
|
|||
end
|
||||
|
||||
accounts.each do |account|
|
||||
GenerateBalanceJob.perform_async(account.id)
|
||||
GenerateBalanceJob.perform(account.id)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,4 @@
|
|||
class SyncPlaidItemAccountsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(item_id)
|
||||
connection = Connection.find_by(source: 'plaid', item_id: item_id)
|
||||
|
@ -38,12 +37,12 @@ class SyncPlaidItemAccountsJob
|
|||
)
|
||||
connection_account.save
|
||||
|
||||
#GenerateBalanceJob.perform_async(connection_account.id)
|
||||
#GenerateBalanceJob.perform(connection_account.id)
|
||||
end
|
||||
|
||||
connection.update(sync_status: 'idle')
|
||||
|
||||
SyncPlaidTransactionsJob.perform_async(item_id)
|
||||
SyncPlaidHoldingsJob.perform_async(item_id)
|
||||
SyncPlaidTransactionsJob.perform(item_id)
|
||||
SyncPlaidHoldingsJob.perform(item_id)
|
||||
end
|
||||
end
|
|
@ -1,5 +1,4 @@
|
|||
class SyncPlaidTransactionsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(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
|
||||
end
|
||||
|
||||
EnrichTransactionsJob.perform_async
|
||||
EnrichTransactionsJob.perform
|
||||
|
||||
accounts.each do |account|
|
||||
GenerateBalanceJob.perform_async(account.id)
|
||||
GenerateBalanceJob.perform(account.id)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,4 @@
|
|||
class SyncPropertyValuesJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(account_id)
|
||||
account = Account.find(account_id)
|
|
@ -1,5 +1,4 @@
|
|||
class SyncSecurityDetailsJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(security_id)
|
||||
security = Security.find_by(id: security_id)
|
|
@ -1,5 +1,4 @@
|
|||
class SyncSecurityHistoryJob
|
||||
include Sidekiq::Job
|
||||
|
||||
def perform(security_id)
|
||||
security = Security.find(security_id)
|
Loading…
Add table
Add a link
Reference in a new issue