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

fix(cache): global cache init #6314

Merged
merged 6 commits into from
May 24, 2020
Merged

fix(cache): global cache init #6314

merged 6 commits into from
May 24, 2020

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented May 24, 2020

Refactors the global file cache so that it is inactive unless initialized.

# Conflicts:
#	lib/datasource/docker/index.spec.ts
#	lib/datasource/github-releases/index.spec.ts
#	lib/datasource/github-tags/index.spec.ts
#	lib/datasource/gitlab-tags/index.spec.ts
#	lib/datasource/helm/index.spec.ts
#	lib/datasource/npm/index.spec.ts
#	lib/datasource/nuget/index.spec.ts
#	lib/datasource/orb/index.spec.ts
#	lib/datasource/packagist/index.spec.ts
#	lib/datasource/pod/index.spec.ts
#	lib/datasource/ruby-version/index.spec.ts
#	lib/workers/pr/changelog/index.spec.ts
@rarkins rarkins requested a review from viceice May 24, 2020 05:20
@lgtm-com

This comment has been minimized.

lib/util/cache/global/file.spec.ts Show resolved Hide resolved

function getGlobalKey(namespace: string, key: string): string {
return `global%%${namespace}%%${key}`;
}

export function get<T = any>(namespace: string, key: string): Promise<T> {
if (!initComplete) {
Copy link
Member

Choose a reason for hiding this comment

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

Simply test for global.renovateCache here, so you are able to override it in the app

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True, that's a better stepping stone. I plan to add Redis support here after this

Copy link
Member

Choose a reason for hiding this comment

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

What about initialize renovateCache in this file init function and simply set global.renovateCache = fileCache ?

@rarkins rarkins requested a review from viceice May 24, 2020 08:40
@rarkins rarkins merged commit 0aae466 into master May 24, 2020
@rarkins rarkins deleted the fix/global-cache-init branch May 24, 2020 08:59
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 20.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants