From 1fbae6e22e0f1965cda7245c8c69ddcbb5c3c758 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Mon, 28 Mar 2022 14:09:26 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Updated=20some=20process=20vars?= =?UTF-8?q?=20in=20the=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- moleculer.config.ts | 2 +- utils/uncompression.utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moleculer.config.ts b/moleculer.config.ts index d1d1b95..fb5e8ad 100644 --- a/moleculer.config.ts +++ b/moleculer.config.ts @@ -91,7 +91,7 @@ const brokerConfig: BrokerOptions = { // More info: https://moleculer.services/docs/0.14/networking.html // Note: During the development, you don't need to define it because all services will be loaded locally. // In production you can set it via `TRANSPORTER=nats://localhost:4222` environment variable. - transporter: "redis://localhost:6379", + transporter: process.env.REDIS_URI || "redis://localhost:6379", // Define a cacher. // More info: https://moleculer.services/docs/0.14/caching.html diff --git a/utils/uncompression.utils.ts b/utils/uncompression.utils.ts index 38cd324..f1c8ece 100644 --- a/utils/uncompression.utils.ts +++ b/utils/uncompression.utils.ts @@ -62,7 +62,7 @@ interface RarFile { compression: string; } - +const UNRAR_BIN_PATH = process.env.UNRAR_BIN_PATH || "/usr/local/bin/unrar/" export const extractComicInfoXMLFromRar = async ( filePath: string ): Promise => { @@ -81,7 +81,7 @@ export const extractComicInfoXMLFromRar = async ( console.info(`%s was created.`, targetDirectory); const archive = new Unrar({ path: path.resolve(filePath), - bin: `/usr/local/bin/unrar`, // this will change depending on Docker base OS + bin: `${UNRAR_BIN_PATH}`, // this will change depending on Docker base OS }); const filesInArchive: [RarFile] = await new Promise((resolve, reject) => { return archive.list((err, entries) => {