Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clean): use postgres advisory locks to ensure only one process can run a clean at a time #672

Merged
merged 14 commits into from
Mar 27, 2024

Conversation

bethesque
Copy link
Member

@bethesque bethesque commented Mar 22, 2024

#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.

@bethesque bethesque requested review from vwong, tuan-pham and Saup21 March 26, 2024 02:01
@bethesque bethesque merged commit 637c25f into master Mar 27, 2024
17 checks passed
@bethesque bethesque deleted the feat/PACT-693-add-clean-locks-2 branch March 27, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants