Skip to content

Commit

Permalink
experiment: connect to redis client in server init
Browse files Browse the repository at this point in the history
  • Loading branch information
larwaa committed Jul 14, 2023
1 parent e8c839e commit ea0387f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/lib/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ export const redisClient = createClient({
tls: true,
},
});

redisClient.connect().catch((err) => {
console.error("Redis connection failed with error", err);
});
redisClient.ping();
4 changes: 4 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ async function initializeServer() {
const app = express();
const httpServer = http.createServer(app);

await redisClient.connect().catch((err) => {
console.error("Redis connection failed with error", err);
});

app.use(Sentry.Handlers.requestHandler());
app.use(
session({
Expand Down

0 comments on commit ea0387f

Please sign in to comment.