File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
overrides/incrementalCache Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,15 @@ const buildDynamoKey = (key: string) => {
50
50
*/
51
51
const multiTierCache : IncrementalCache = {
52
52
name : "multi-tier-ddb-s3" ,
53
- async get ( key , isFetch ) {
53
+ async get < IsFetch extends boolean = false > ( key : string , isFetch ?: IsFetch ) {
54
54
// First we check the local cache
55
- const localCacheEntry = localCache . get ( key ) ;
55
+ const localCacheEntry = localCache . get ( key ) as
56
+ | {
57
+ value : CacheValue < IsFetch > ;
58
+ lastModified : number ;
59
+ }
60
+ | undefined ;
61
+
56
62
if ( localCacheEntry ) {
57
63
if ( Date . now ( ) - localCacheEntry . lastModified < localCacheTTL ) {
58
64
debug ( "Using local cache without checking ddb" ) ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export type WithLastModified<T> = {
76
76
} ;
77
77
78
78
export type CacheValue < IsFetch extends boolean > = ( IsFetch extends true
79
- ? Partial < CachedFetchValue >
79
+ ? CachedFetchValue
80
80
: CachedFile ) & { revalidate ?: number | false } ;
81
81
82
82
export type IncrementalCache = {
You can’t perform that action at this time.
0 commit comments