@@ -94,23 +94,19 @@ class MomentoCachePersistenceLayer extends BasePersistenceLayer {
94
94
}
95
95
}
96
96
97
- try {
98
- const ttl = record . expiryTimestamp
99
- ? Math . floor ( new Date ( record . expiryTimestamp * 1000 ) . getTime ( ) / 1000 ) -
100
- Math . floor ( new Date ( ) . getTime ( ) / 1000 )
101
- : this . getExpiresAfterSeconds ( ) ;
102
-
103
- const response = await (
104
- await this . #getClient( )
105
- ) . dictionarySetFields ( this . #cacheName, record . idempotencyKey , item , {
106
- ttl : CollectionTtl . of ( ttl ) . withNoRefreshTtlOnUpdates ( ) ,
107
- } ) ;
97
+ const ttl = record . expiryTimestamp
98
+ ? Math . floor ( new Date ( record . expiryTimestamp * 1000 ) . getTime ( ) / 1000 ) -
99
+ Math . floor ( new Date ( ) . getTime ( ) / 1000 )
100
+ : this . getExpiresAfterSeconds ( ) ;
108
101
109
- if ( response instanceof CacheDictionarySetFields . Error ) {
110
- throw new Error ( `Unable to put item: ${ response . errorCode ( ) } ` ) ;
111
- }
112
- } catch ( error ) {
113
- throw error ;
102
+ const response = await (
103
+ await this . #getClient( )
104
+ ) . dictionarySetFields ( this . #cacheName, record . idempotencyKey , item , {
105
+ ttl : CollectionTtl . of ( ttl ) . withNoRefreshTtlOnUpdates ( ) ,
106
+ } ) ;
107
+
108
+ if ( response instanceof CacheDictionarySetFields . Error ) {
109
+ throw new Error ( `Unable to put item: ${ response . errorCode ( ) } ` ) ;
114
110
}
115
111
}
116
112
0 commit comments