mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
Fix ActiveJob::DeserializationError in AccountSyncJob when an account doesn't exists
This commit is contained in:
parent
8b19b36a9c
commit
8dbf634819
2 changed files with 5 additions and 2 deletions
|
@ -1,7 +1,10 @@
|
||||||
class AccountSyncJob < ApplicationJob
|
class AccountSyncJob < ApplicationJob
|
||||||
queue_as :default
|
queue_as :default
|
||||||
|
|
||||||
def perform(account)
|
def perform(account_id)
|
||||||
|
account = Account.find_by(id: account_id)
|
||||||
|
return unless account.present?
|
||||||
|
|
||||||
account.sync
|
account.sync
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Account::Syncable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def sync_later
|
def sync_later
|
||||||
AccountSyncJob.perform_later self
|
AccountSyncJob.perform_later(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sync
|
def sync
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue