Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.1] Backport #54854 into 5.1#55261

Merged
unknwon merged 1 commit into
5.1from
backport-54854-to-5.1
Jul 25, 2023
Merged

[Backport 5.1] Backport #54854 into 5.1#55261
unknwon merged 1 commit into
5.1from
backport-54854-to-5.1

Conversation

@kopancek

Copy link
Copy Markdown
Contributor

Backport #54854 into 5.1

Test plan

backport PR, N/A

Moving licensing checks to a singleton worker job. This way we make sure
that only one license check API call is being made on each 12-hour tick.

Previously this lived in a frontend service. If multiple frontend
services were running, this would fire multiple requests, which is
undesirable from many points of view - waste of resources, waste of
bandwidth, potential concurrency issues.

Having it fire multiple times would also break an assumption that we
have in the license check handler on dotcom. For checking if same
site_id is used on multiple instances, we assume that the time
difference between license check calls would be roughly 10-12 hours.
Calling twice in the same second breaks this assumption.

Tested locally that the worker starts

(cherry picked from commit 6732a5f)
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 65b0a23...962f71f.

Notify File(s)
@efritz cmd/worker/internal/licensecheck/BUILD.bazel
cmd/worker/internal/licensecheck/check.go
cmd/worker/internal/licensecheck/check_test.go
cmd/worker/internal/licensecheck/worker.go
cmd/worker/shared/BUILD.bazel
cmd/worker/shared/main.go
@sourcegraph/delivery doc/admin/workers.md
@unknwon enterprise/cmd/frontend/internal/licensing/init/init.go
internal/licensing/BUILD.bazel
internal/licensing/constants.go
internal/licensing/licensing.go
internal/licensing/licensing_test.go

@sourcegraph-bot

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@kopancek kopancek left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed conflicts, seems to be working OK for me locally

@kopancek kopancek requested a review from a team July 25, 2023 15:16
@unknwon unknwon merged commit 7acc240 into 5.1 Jul 25, 2023
@unknwon unknwon deleted the backport-54854-to-5.1 branch July 25, 2023 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants