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

listener: add account-level locking #107

Merged
merged 1 commit into from Nov 8, 2019

Conversation

@pierre
Copy link
Member

pierre commented Nov 7, 2019

Groups INVOICES and INVOICE_AND_PAYMENTS can overlap: add account-level locking as a workaround.

@pierre pierre requested a review from sbrossie Nov 7, 2019
Groups INVOICES and INVOICE_AND_PAYMENTS can overlap:
add account-level locking as a workaround.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
@pierre pierre force-pushed the lock-account branch from 7ff316d to 4a7092b Nov 7, 2019
@@ -304,6 +310,20 @@ private boolean jobsOverlap(final AnalyticsJob job, final NotificationEventWithM
}

private void handleAnalyticsJob(final AnalyticsJob job) throws AnalyticsRefreshException {
GlobalLock lock = null;
try {
lock = locker.lockWithNumberOfTries("ANALYTICS_REFRESH", job.getAccountId().toString(), 100);

This comment has been minimized.

Copy link
@sbrossie

sbrossie Nov 7, 2019

Member

Nit: ANALYTICS_REFRESH -> ANALYTICS_REFRESH-

This comment has been minimized.

Copy link
@sbrossie
@sbrossie sbrossie merged commit 0c1b9a5 into work-for-release-0.21.x Nov 8, 2019
4 checks passed
4 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: test-h2 Your tests passed on CircleCI!
Details
ci/circleci: test-mysql Your tests passed on CircleCI!
Details
ci/circleci: test-postgresql Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.