2021-10-08 14:24:05 +02:00
|
|
|
const envOption = {
|
|
|
|
onlyQueue: false,
|
|
|
|
onlyServer: false,
|
|
|
|
noDaemons: false,
|
|
|
|
disableClustering: false,
|
|
|
|
verbose: false,
|
|
|
|
withLogTime: false,
|
|
|
|
quiet: false,
|
|
|
|
slow: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
for (const key of Object.keys(envOption) as (keyof typeof envOption)[]) {
|
2023-01-13 05:40:33 +01:00
|
|
|
if (
|
|
|
|
process.env[
|
|
|
|
`MK_${key.replace(/[A-Z]/g, (letter) => `_${letter}`).toUpperCase()}`
|
|
|
|
]
|
|
|
|
)
|
|
|
|
envOption[key] = true;
|
2021-10-08 14:24:05 +02:00
|
|
|
}
|
|
|
|
|
2023-01-13 05:40:33 +01:00
|
|
|
if (process.env.NODE_ENV === "test") envOption.disableClustering = true;
|
|
|
|
if (process.env.NODE_ENV === "test") envOption.quiet = true;
|
|
|
|
if (process.env.NODE_ENV === "test") envOption.noDaemons = true;
|
2021-10-08 14:24:05 +02:00
|
|
|
|
|
|
|
export { envOption };
|