fix: make cache optional fields optional (#9942)

This patch allows the getFromCache caller to only pass in
identifier or query field, as getFromCache already handles
the identifier and query field checks

Co-authored-by: ru.c <ru@shuffle.com>
This commit is contained in:
RustySol 2023-04-15 17:47:12 +08:00 committed by GitHub
parent 06291cfb31
commit 159c60a6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -131,7 +131,7 @@ export class DbQueryResultCache implements QueryResultCache {
}
/**
* Caches given query result.
* Get data from cache.
* Returns cache result if found.
* Returns undefined if result is not cached.
*/

View File

@ -6,7 +6,7 @@ export interface QueryResultCacheOptions {
* Cache identifier set by user.
* Can be empty.
*/
identifier: string
identifier?: string
/**
* Time, when cache was created.
@ -21,7 +21,7 @@ export interface QueryResultCacheOptions {
/**
* Cached query.
*/
query: string
query?: string
/**
* Query result that will be cached.

View File

@ -123,7 +123,7 @@ export class RedisQueryResultCache implements QueryResultCache {
async synchronize(queryRunner: QueryRunner): Promise<void> {}
/**
* Caches given query result.
* Get data from cache.
* Returns cache result if found.
* Returns undefined if result is not cached.
*/