ankane / authtrail

Track Devise login activity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Race conditions in Sidekiq

davidlowry opened this issue · comments

Hi there

I have an issue where my Geocoding jobs arent being completed by Sidekiq and are returning a deserialization error as follows. Is there any way to hint to the authtrail geocoder 'service' to make those actions only after the create commit action, or to indicate they should wait for a while before occuring?

just now | default | AuthTrail::GeocodeJob | {"_aj_globalid"=>"gid://app/LoginActivity/619929"} | ActiveJob::DeserializationError: Error while trying to deserialize arguments: Couldn't find LoginActivity with 'id'=619929
ActiveJob::DeserializationError: Error while trying to deserialize arguments: Couldn't find LoginActivity with 'id'=619929

Thanks
David

Hey @davidlowry, the job isn't enqueued until after the transaction is committed. You can customize the track_method as needed.