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(config): do not cache tile sets forever as they can be updated #1790

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

blacha
Copy link
Member

@blacha blacha commented Jul 28, 2021

This fixes a issue where a database update is applied but some lambdas will hold onto the old config until they get restarted

This fixes a issue where a database update is applied but some lambdas will hold onto the old config until they get restarted
@@ -110,7 +110,7 @@ async function useLocal(): Promise<void> {
const requestId = ulid.ulid();
const logger = LogConfig.get().child({ id: requestId });

const tileSets = await Promise.all([...TileSets.cache.values()]);
const tileSets = await Promise.all([...TileSets.cache.values()].map((c) => c.value));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change for Cloning the TileSets values?

Copy link
Member Author

Choose a reason for hiding this comment

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

this change is because we now store the time of when we fetched the object last.

so the [....cache.values()] has gone form TileSet[] to

{ value: TileSet, time: number}[]

@blacha blacha merged commit d0b1c89 into master Jul 29, 2021
@blacha blacha deleted the fix/tileset-cache-invalidation branch July 29, 2021 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants