Skip to content

Commit c270b13

Browse files
authored
fix(docs): remove local cache (#3283)
1 parent d1c10f6 commit c270b13

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

servers/fdr/src/app/FdrApplication.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
DocsDefinitionCache,
1010
DocsDefinitionCacheImpl,
1111
} from "../services/docs-cache/DocsDefinitionCache";
12-
import LocalDocsDefinitionStore from "../services/docs-cache/LocalDocsDefinitionStore";
1312
import RedisDocsDefinitionStore from "../services/docs-cache/RedisDocsDefinitionStore";
1413
import { LocalRevalidatorServiceImpl } from "../services/revalidator/LocalRevalidatorService";
1514
import {
@@ -87,7 +86,6 @@ export class FdrApplication {
8786
this.docsDefinitionCache = new DocsDefinitionCacheImpl(
8887
this,
8988
this.dao,
90-
new LocalDocsDefinitionStore(),
9189
this.redisDatastore
9290
);
9391

servers/fdr/src/services/docs-cache/DocsDefinitionCache.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
import { DocsRegistrationInfo } from "../../controllers/docs/v2/getDocsWriteV2Service";
1313
import { FdrDao } from "../../db";
1414
import { Semaphore } from "../revalidator/Semaphore";
15-
import LocalDocsDefinitionStore from "./LocalDocsDefinitionStore";
1615
import RedisDocsDefinitionStore from "./RedisDocsDefinitionStore";
1716

1817
const DOCS_DOMAIN_REGX = /^([^.\s]+)/;
@@ -66,18 +65,15 @@ export interface CachedDocsResponse {
6665
}
6766

6867
export class DocsDefinitionCacheImpl implements DocsDefinitionCache {
69-
private localDocsCache: LocalDocsDefinitionStore;
7068
private redisDocsCache: RedisDocsDefinitionStore | undefined;
7169
private DOCS_WRITE_MONITOR: Record<string, Semaphore> = {};
7270
private initialized: boolean = false;
7371

7472
constructor(
7573
private readonly app: FdrApplication,
7674
private readonly dao: FdrDao,
77-
localDocsCache: LocalDocsDefinitionStore,
7875
redisDocsCache: RedisDocsDefinitionStore | undefined
7976
) {
80-
this.localDocsCache = localDocsCache;
8177
this.redisDocsCache = redisDocsCache;
8278
}
8379

@@ -106,7 +102,6 @@ export class DocsDefinitionCacheImpl implements DocsDefinitionCache {
106102
if (this.redisDocsCache) {
107103
await this.redisDocsCache.delete({ url });
108104
}
109-
this.localDocsCache.delete({ url });
110105
}
111106

112107
public async getDocsForUrl({
@@ -228,7 +223,6 @@ export class DocsDefinitionCacheImpl implements DocsDefinitionCache {
228223
if (this.redisDocsCache) {
229224
await this.redisDocsCache.set({ url, value });
230225
}
231-
this.localDocsCache.set({ url, value });
232226
}
233227

234228
private async getDocsForUrlFromCache({
@@ -240,7 +234,7 @@ export class DocsDefinitionCacheImpl implements DocsDefinitionCache {
240234
if (this.redisDocsCache) {
241235
record = await this.redisDocsCache.get({ url });
242236
} else {
243-
record = this.localDocsCache.get({ url }) ?? null;
237+
record = null;
244238
}
245239
if (record != null && record.version !== SEMANTIC_VERSION) {
246240
return null;

servers/fdr/src/services/docs-cache/LocalDocsDefinitionStore.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)