unblock gamma pipeline

This commit is contained in:
Maidul Islam
2023-11-21 17:45:01 -05:00
parent 1f5e458b64
commit 3478d71e99
3 changed files with 13 additions and 7 deletions
+4 -1
View File
@@ -97,14 +97,17 @@ import { githubPushEventSecretScan } from "./queues/secret-scanning/githubScanPu
const SmeeClient = require("smee-client"); // eslint-disable-line const SmeeClient = require("smee-client"); // eslint-disable-line
import path from "path"; import path from "path";
import { serverConfigInit } from "./config/serverConfig"; import { serverConfigInit } from "./config/serverConfig";
import { initRedis } from "./services/RedisService";
let handler: null | any = null; let handler: null | any = null;
const main = async () => { const main = async () => {
await initLogger(); await initLogger();
const port = await getPort(); const port = await getPort();
// initializing the database connection // initializing the database connection + redis
await initRedis()
await DatabaseService.initDatabase(await getMongoURL()); await DatabaseService.initDatabase(await getMongoURL());
const serverCfg = await serverConfigInit(); const serverCfg = await serverConfigInit();
await setup(); await setup();
+8 -5
View File
@@ -3,11 +3,14 @@ import { logger } from "../utils/logging";
let redisClient: TRedis | null; let redisClient: TRedis | null;
if (process.env.REDIS_URL) { export const initRedis = async () => {
redisClient = new Redis(process.env.REDIS_URL as string); if (process.env.REDIS_URL) {
} else { redisClient = new Redis(process.env.REDIS_URL as string);
logger.warn("Redis URL not set, skipping Redis initialization."); } else {
redisClient = null; logger.warn("Redis URL not set, skipping Redis initialization.");
redisClient = null;
}
} }
export { redisClient }; export { redisClient };
+1 -1
View File
@@ -19,7 +19,7 @@ export const initLogger = async () => {
const isProduction = nodeEnv === "production"; const isProduction = nodeEnv === "production";
const targets: pino.TransportMultiOptions["targets"][number][] = [ const targets: pino.TransportMultiOptions["targets"][number][] = [
isProduction isProduction
? { level: "info", target: "pino/file", options: { destination: 'logs/infisical-backend/logs.txt', mkdir: true } } ? { level: "info", target: "pino/file", options: {} }
: { : {
level: "info", level: "info",
target: "pino-pretty", // must be installed separately target: "pino-pretty", // must be installed separately