Use a Postgres advisory lock to ensure that only one "clean" rake task can run at a time.
This allows a cron schedule to be used on the Pact Broker Docker image when deployed on a multi-instance architecture, without all the instances stepping on each other's toes.
Any tasks that attempt to run while a clean job is running will skip the clean and exit with a message and a success code.
Use Postgres advisory locks to ensure that only one thread can run a schema or data migration at a time during startup.
https://github.com/pact-foundation/pact_broker/issues/488
Use a Postgres advisory lock to ensure that only one "clean" rake task can run at a time. This allows a cron schedule to be used on the Pact Broker Docker image when deployed on a multi-instance architecture, without all the instances stepping on each other's toes. Any tasks that attempt to run while a clean job is running will skip the clean and exit with a message and a success code.
Use Postgres advisory locks to ensure that only one thread can run a schema or data migration at a time during startup.