mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 07:28:21 +00:00
unblock gamma pipeline
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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 };
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user