File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed
packages/service-utils/src/cf-worker Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,24 @@ export async function authorizeWorker(
5959 get : async ( clientId : string ) => serviceConfig . kvStore . get ( clientId ) ,
6060 put : ( clientId : string , teamAndProjectResponse : TeamAndProjectResponse ) =>
6161 serviceConfig . ctx . waitUntil (
62- serviceConfig . kvStore . put (
63- clientId ,
64- JSON . stringify ( {
65- updatedAt : Date . now ( ) ,
66- teamAndProjectResponse,
67- } satisfies TeamAndProjectCacheWithPossibleTTL ) ,
68- {
69- expirationTtl :
70- serviceConfig . cacheTtlSeconds &&
71- serviceConfig . cacheTtlSeconds >= DEFAULT_CACHE_TTL_SECONDS
72- ? serviceConfig . cacheTtlSeconds
73- : DEFAULT_CACHE_TTL_SECONDS ,
74- } ,
75- ) ,
62+ serviceConfig . kvStore
63+ . put (
64+ clientId ,
65+ JSON . stringify ( {
66+ updatedAt : Date . now ( ) ,
67+ teamAndProjectResponse,
68+ } satisfies TeamAndProjectCacheWithPossibleTTL ) ,
69+ {
70+ expirationTtl :
71+ serviceConfig . cacheTtlSeconds &&
72+ serviceConfig . cacheTtlSeconds >= DEFAULT_CACHE_TTL_SECONDS
73+ ? serviceConfig . cacheTtlSeconds
74+ : DEFAULT_CACHE_TTL_SECONDS ,
75+ } ,
76+ )
77+ . catch ( ( e ) => {
78+ console . error ( e ) ;
79+ } ) ,
7680 ) ,
7781 cacheTtlSeconds : serviceConfig . cacheTtlSeconds ?? DEFAULT_CACHE_TTL_SECONDS ,
7882 } ) ;
You can’t perform that action at this time.
0 commit comments