1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Fix ActiveJob::DeserializationError in AccountSyncJob when an account doesn't exists

This commit is contained in:
Mattia Malnis 2024-03-29 17:02:17 +01:00
parent 8b19b36a9c
commit 8dbf634819
2 changed files with 5 additions and 2 deletions

View file

@ -1,7 +1,10 @@
class AccountSyncJob < ApplicationJob
queue_as :default
def perform(account)
def perform(account_id)
account = Account.find_by(id: account_id)
return unless account.present?
account.sync
end
end

View file

@ -2,7 +2,7 @@ module Account::Syncable
extend ActiveSupport::Concern
def sync_later
AccountSyncJob.perform_later self
AccountSyncJob.perform_later(id)
end
def sync