Skip to content

Commit d80285a

Browse files
authored
fix(compiler): remove local variable cache (#947)
Local cache is in `dictionary.json` file.
1 parent 1b8ed72 commit d80285a

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

.changeset/clever-frogs-clean.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@lingo.dev/_compiler": patch
3+
"lingo.dev": patch
4+
---
5+
6+
remove local variable cache

packages/compiler/src/lib/lcp/server.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,13 @@ export type LCPServerParamsForLocale = {
2727
};
2828

2929
export class LCPServer {
30-
private static dictionariesCache: Record<string, DictionarySchema> | null =
31-
null;
3230
private static inFlightPromise: Promise<
3331
Record<string, DictionarySchema>
3432
> | null = null;
3533

3634
static async loadDictionaries(
3735
params: LCPServerParams,
3836
): Promise<Record<string, DictionarySchema>> {
39-
// Return cached dictionaries if available
40-
if (this.dictionariesCache) {
41-
return this.dictionariesCache;
42-
}
43-
4437
// If a load is already in progress, await it
4538
if (this.inFlightPromise) {
4639
return this.inFlightPromise;
@@ -67,9 +60,6 @@ export class LCPServer {
6760
]),
6861
);
6962

70-
// Cache for subsequent requests within the same process
71-
this.dictionariesCache = result;
72-
7363
return result;
7464
} finally {
7565
// Clear inFlightPromise regardless of success/failure

0 commit comments

Comments
 (0)