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

Use the mongo cache if less than a day old #2304

Merged
merged 1 commit into from Mar 28, 2024
Merged

Conversation

tzjames
Copy link
Collaborator

@tzjames tzjames commented Mar 28, 2024

Features and Changes

On cloud we push code often which restarts the servers. In order to make sure that we call the license server only once a day in the usual case, we can rely on the mongo cache if the in memory cache doesn't exist. Only if the memory cache is older than a day will we then call the license server.

If the license server is down, we will continue the functionality where we allow using the mongo cache for up to a week.

  • Uses licenseModel if it is less than a day old and in memory doesn't exist
  • Adds tests for that
  • Adds additional test for if we didn't call the function with the proper args
  • Fixes a test that would have succeeded because it was using the LicenseModel first rather than it being 2 days old and the license server is down.

Testing

yarn test

Copy link

Your preview environment pr-2304-bttf has been deployed.

Preview environment endpoints are available at:

@tzjames tzjames merged commit cfa16fa into main Mar 28, 2024
3 checks passed
@tzjames tzjames deleted the ji/use-mongo-cache-first branch March 28, 2024 16:59
@tzjames tzjames mentioned this pull request Mar 28, 2024
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.

None yet

2 participants