Skip to content

Commit

Permalink
debug: adds await back in to create Client
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoldknott committed Jan 12, 2024
1 parent f0af307 commit d1fbd81
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frontend_svelte/src/lib/server/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ if ( !building) {
console.log(appConfig.redis_host);
console.log(appConfig.redis_port);
console.log(appConfig.redis_session_db);
redisClient = createClient({
redisClient = await createClient({
url: `${connectionString}/${appConfig.redis_session_db}`,
})
}).on('error', err => console.error('🥞 cache - server - Redis Client create error', err))
console.log("🥞 cache - server - createRedisClient - redisClient created");
console.log(redisClient);
// await new Promise((resolve) => setTimeout(resolve, 10000))
await redisClient.connect()
console.log("🥞 cache - server - createRedisClient - redisClient connected");
} catch (err) {
console.error("🥞 cache - server - createRedisClient - createClient failed");
console.error("🥞 cache - server - createRedisClient - createClient and connect failed");
// consider let that error bubble up to the caller - in prod a failed redis connection should be fatal!
// the application needs to restart in its container!
console.error(err);
Expand Down Expand Up @@ -119,9 +121,9 @@ export const setSession = async (sessionId: string, path: string, sessionData: S
console.log(redisClient?.isOpen);
}

const dummies = await getDummys();
console.log("🥞 cache - server - setSession - getDummies");
console.log(dummies);
// const dummies = await getDummys();
// console.log("🥞 cache - server - setSession - getDummies");
// console.log(dummies);
// console.log("🥞 cache - server - setSession - sessionData.account.localAccountId");
// console.log(sessionData.account.localAccountId);
const authDataString = JSON.stringify(sessionData);
Expand Down

0 comments on commit d1fbd81

Please sign in to comment.