Skip to content

Commit

Permalink
fix: make cache optional fields optional (#9942)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
RustySol and ru.c committed Apr 15, 2023
1 parent 06291cf commit 159c60a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cache/DbQueryResultCache.ts
Expand Up @@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/cache/QueryResultCacheOptions.ts
Expand Up @@ -6,7 +6,7 @@ export interface QueryResultCacheOptions {
* Cache identifier set by user.
* Can be empty.
*/
identifier: string
identifier?: string

/**
* Time, when cache was created.
Expand All @@ -21,7 +21,7 @@ export interface QueryResultCacheOptions {
/**
* Cached query.
*/
query: string
query?: string

/**
* Query result that will be cached.
Expand Down
2 changes: 1 addition & 1 deletion src/cache/RedisQueryResultCache.ts
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 159c60a

Please sign in to comment.