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(scripts): use redlock to prevent >1 instance of paypal-processor #12610

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

chenba
Copy link
Contributor

@chenba chenba commented Apr 20, 2022

Because:

  • we could easily end up running two instances of the paypal-processor
    during a deploy

This commit:

  • use a redis based distributed lock to ensure only one
    paypal-processor can run per env
  • add script options to control the lock name and duration, as well as
    completely bypassing the lock

@chenba chenba requested a review from bbangert April 20, 2022 21:57
@chenba chenba requested a review from a team as a code owner April 20, 2022 21:57
@chenba
Copy link
Contributor Author

chenba commented Apr 20, 2022

@bbangert Here's the auto-renewing lock approach. It feels cleaner since we get out of the business of running a timer and manually extending the lock.

@bbangert
Copy link
Member

@chenba yep, agreed, this is a bit cleaner.

Because:
 - we could easily end up running two instances of the paypal-processor
   during a deploy

This commit:
 - use a redis based distributed lock to ensure only one
   paypal-processor can run per env
 - add script options to control the lock name and duration, as well as
   completely bypassing the lock
@chenba chenba force-pushed the fxa-4698-paypal-lock-auto-extend branch from 0257267 to 8adcdc0 Compare April 21, 2022 15:27
Copy link
Member

@bbangert bbangert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chenba chenba merged commit 9c43c3a into main Apr 21, 2022
@chenba chenba deleted the fxa-4698-paypal-lock-auto-extend branch April 21, 2022 17:57
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