Skip to main content

ActiveJob::Uniqueness

Where?​

uala-core/lib/uala/core/initializers/active_job_uniqueness.rb

Why?​

It's related to ComputeVenueAvailabilityJob and usage of this lock manager is only there. It's an attempt to build custom behaviour for lock manager that uses Redis to lock the job. It's used to avoid running the same job multiple times in parallel. But unless the original implementation the logic of lock check is a bit different.

The key difference added by the monkey patch​

The original ActiveJob::Uniqueness based on TTL of the key. It means that if the key is expired, the duplicate job will be executed. The monkey patch changes the logic to check just the existence of the key without checking the TTL. Probably we need to have this logic because of the nature of the job. It can be too (unpredictable) long.