Skip to content

Commit 159c60a

Browse files
authored
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 <[email protected]>
1 parent 06291cf commit 159c60a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cache/DbQueryResultCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class DbQueryResultCache implements QueryResultCache {
131131
}
132132

133133
/**
134-
* Caches given query result.
134+
* Get data from cache.
135135
* Returns cache result if found.
136136
* Returns undefined if result is not cached.
137137
*/

src/cache/QueryResultCacheOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface QueryResultCacheOptions {
66
* Cache identifier set by user.
77
* Can be empty.
88
*/
9-
identifier: string
9+
identifier?: string
1010

1111
/**
1212
* Time, when cache was created.
@@ -21,7 +21,7 @@ export interface QueryResultCacheOptions {
2121
/**
2222
* Cached query.
2323
*/
24-
query: string
24+
query?: string
2525

2626
/**
2727
* Query result that will be cached.

src/cache/RedisQueryResultCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class RedisQueryResultCache implements QueryResultCache {
123123
async synchronize(queryRunner: QueryRunner): Promise<void> {}
124124

125125
/**
126-
* Caches given query result.
126+
* Get data from cache.
127127
* Returns cache result if found.
128128
* Returns undefined if result is not cached.
129129
*/

0 commit comments

Comments
 (0)