1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

wip: cache

This commit is contained in:
Samuel 2023-03-17 19:47:23 +01:00
parent cae6fcc72a
commit 2e473576cf
2 changed files with 42 additions and 1 deletions

42
src/util/util/Cache.ts Normal file
View File

@ -0,0 +1,42 @@
/* eslint-disable */
import { DataSource, QueryRunner } from "typeorm";
import { QueryResultCache } from "typeorm/cache/QueryResultCache";
import { QueryResultCacheOptions } from "typeorm/cache/QueryResultCacheOptions";
export class CustomQueryResultCache implements QueryResultCache {
constructor(private dataSource: DataSource) {}
connect(): Promise<void> {
throw new Error("Method not implemented.");
}
disconnect(): Promise<void> {
throw new Error("Method not implemented.");
}
synchronize(queryRunner?: QueryRunner | undefined): Promise<void> {
throw new Error("Method not implemented.");
}
getFromCache(
options: QueryResultCacheOptions,
queryRunner?: QueryRunner | undefined,
): Promise<QueryResultCacheOptions | undefined> {
throw new Error("Method not implemented.");
}
storeInCache(
options: QueryResultCacheOptions,
savedCache: QueryResultCacheOptions | undefined,
queryRunner?: QueryRunner | undefined,
): Promise<void> {
throw new Error("Method not implemented.");
}
isExpired(savedCache: QueryResultCacheOptions): boolean {
throw new Error("Method not implemented.");
}
clear(queryRunner?: QueryRunner | undefined): Promise<void> {
throw new Error("Method not implemented.");
}
remove(
identifiers: string[],
queryRunner?: QueryRunner | undefined,
): Promise<void> {
throw new Error("Method not implemented.");
}
}

View File

@ -63,7 +63,6 @@ const DataSourceOptions = new DataSource({
supportBigNumbers: true,
name: "default",
migrations: [path.join(__dirname, "..", "migration", DatabaseType, "*.js")],
cache: true,
});
// Gets the existing database connection