1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

Changed perform_asnyc to perform sincen GoodJob does not use perform_async

This commit is contained in:
Claude Ayitey 2024-01-06 14:57:33 +00:00
parent dcb44cee65
commit 32ca1fa432
6 changed files with 25 additions and 25 deletions

View file

@ -103,11 +103,11 @@ class AccountsController < ApplicationController
# Save the account # Save the account
if @account.save if @account.save
GenerateBalanceJob.perform_async(@account.id) GenerateBalanceJob.perform(@account.id)
GenerateMetricsJob.perform_in(15.seconds, current_family.id) GenerateMetricsJob.perform_in(15.seconds, current_family.id)
if @account.kind == 'property' and @account.subkind == 'real_estate' if @account.kind == 'property' and @account.subkind == 'real_estate'
SyncPropertyValuesJob.perform_async(@account.id) SyncPropertyValuesJob.perform(@account.id)
end end
# If the account saved, redirect to the accounts page # If the account saved, redirect to the accounts page

View file

@ -41,10 +41,10 @@ class Api::PlaidController < ApplicationController
) )
user.save! user.save!
SyncPlaidItemAccountsJob.perform_async(item_id) SyncPlaidItemAccountsJob.perform(item_id)
# SyncPlaidHoldingsJob.perform_async(item_id) # SyncPlaidHoldingsJob.perform(item_id)
# SyncPlaidInvestmentTransactionsJob.perform_async(item_id) # SyncPlaidInvestmentTransactionsJob.perform(item_id)
GenerateMetricsJob.perform_in(1.minute, user.family.id) GenerateMetricsJob.perform_in(1.minute, user.family.id)

View file

@ -10,7 +10,7 @@ class ConnectionsController < ApplicationController
@connection = current_family.connections.find(params[:id]) @connection = current_family.connections.find(params[:id])
@connection.destroy @connection.destroy
GenerateMetricsJob.perform_async(current_family.id) GenerateMetricsJob.perform(current_family.id)
redirect_to connections_path redirect_to connections_path
end end

View file

@ -38,7 +38,7 @@ class ConversationsController < ApplicationController
reply.role = "assistant" reply.role = "assistant"
reply.save reply.save
AskQuestionJob.perform_async(@conversation.id, reply.id) AskQuestionJob.perform(@conversation.id, reply.id)
#conversation.broadcast_append_to "conversation_area", partial: "conversations/message", locals: { message: reply }, target: "conversation_area_#{conversation.id}" #conversation.broadcast_append_to "conversation_area", partial: "conversations/message", locals: { message: reply }, target: "conversation_area_#{conversation.id}"

View file

@ -7,6 +7,6 @@ class Security < ApplicationRecord
after_create :sync_price_history after_create :sync_price_history
def sync_price_history def sync_price_history
SyncSecurityHistoryJob.perform_async(self.id) SyncSecurityHistoryJob.perform(self.id)
end end
end end

View file

@ -2,48 +2,48 @@ namespace :maintenance do
desc "Quick Update" desc "Quick Update"
task :quick_update => :environment do task :quick_update => :environment do
Connection.all.each do |connection| Connection.all.each do |connection|
SyncPlaidItemAccountsJob.perform_async(connection.item_id) SyncPlaidItemAccountsJob.perform(connection.item_id)
SyncPlaidHoldingsJob.perform_async(connection.item_id) SyncPlaidHoldingsJob.perform(connection.item_id)
SyncPlaidInvestmentTransactionsJob.perform_async(connection.item_id) SyncPlaidInvestmentTransactionsJob.perform(connection.item_id)
GenerateMetricsJob.perform_in(1.minute, connection.family_id) GenerateMetricsJob.perform_in(1.minute, connection.family_id)
end end
EnrichTransactionsJob.perform_async EnrichTransactionsJob.perform
# Sync security prices that haven't been synced in the last 24 hours or are nil # Sync security prices that haven't been synced in the last 24 hours or are nil
Security.where("last_synced_at IS NULL OR last_synced_at < ?", 24.hours.ago).each do |security| Security.where("last_synced_at IS NULL OR last_synced_at < ?", 24.hours.ago).each do |security|
SyncSecurityHistoryJob.perform_async(security.id) SyncSecurityHistoryJob.perform(security.id)
end end
# Sync security real time prices that haven't been synced in the last 30 minutes or are nil # Sync security real time prices that haven't been synced in the last 30 minutes or are nil
Security.where("real_time_price_updated_at IS NULL OR real_time_price_updated_at < ?", 30.minutes.ago).each do |security| Security.where("real_time_price_updated_at IS NULL OR real_time_price_updated_at < ?", 30.minutes.ago).each do |security|
RealTimeSyncJob.perform_async(security.id) RealTimeSyncJob.perform(security.id)
end end
Account.all.each do |account| Account.all.each do |account|
GenerateBalanceJob.perform_async(account.id) GenerateBalanceJob.perform(account.id)
end end
Account.property.each do |account| Account.property.each do |account|
SyncPropertyValuesJob.perform_async(account.id) SyncPropertyValuesJob.perform(account.id)
end end
Family.all.each do |family| Family.all.each do |family|
GenerateCategoricalMetricsJob.perform_async(family.id) GenerateCategoricalMetricsJob.perform(family.id)
end end
end end
desc "Institution Sync" desc "Institution Sync"
task :institution_sync => :environment do task :institution_sync => :environment do
SyncPlaidInstitutionsJob.perform_async SyncPlaidInstitutionsJob.perform_now
end end
desc "Security Details Sync" desc "Security Details Sync"
task :security_details_sync => :environment do task :security_details_sync => :environment do
# Get Security where logo is nil # Get Security where logo is nil
Security.where(logo: nil).each do |security| Security.where(logo: nil).each do |security|
SyncSecurityDetailsJob.perform_async(security.id) SyncSecurityDetailsJob.perform(security.id)
end end
end end