-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: add an env var to generate config or not #25
Conversation
If an environment variable `AKYUU_NO_GENERATE_CONFIG` is set, Akyuu.js won't regenerate the temporary config files. This may avoid multi-times generation of the config files for cluster-worker mode.
@XadillaX 其实感觉这个机制 如果目录 & js & json 重名 不是会覆盖配置文件么 |
@mapleincode 只会遍历目录,忽略文件。 |
} | ||
} | ||
} | ||
|
||
process.env.NODE_CONFIG_DIR = currentDir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of process.env.NODE_CONFIG_DIR = currentDir;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node-config reads configuration files in the ./config directory for the running process, typically the application root. This can be overridden by setting the $NODE_CONFIG_DIR environment variable to the directory containing your configuration files.
$NODE_CONFIG_DIR can be a full path from your root directory, or a relative path from the process if the value begins with ./ or ../.
Refs: https://github.com/lorenwest/node-config/wiki/Configuration-Files#config-directory
We uses config as our configuration base package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
If an environment variable `AKYUU_NO_GENERATE_CONFIG` is set, Akyuu.js won't regenerate the temporary config files. This may avoid multi-times generation of the config files for cluster-worker mode. PR-URL: #25 Reviewed-By: Duan Pengfei <duanpengfei1993@qq.com>
Landed in 2b08b17 |
If an environment variable `AKYUU_NO_GENERATE_CONFIG` is set, Akyuu.js won't regenerate the temporary config files. This may avoid multi-times generation of the config files for cluster-worker mode. PR-URL: #25 Reviewed-By: Duan Pengfei <duanpengfei1993@qq.com>
If an environment variable
AKYUU_NO_GENERATE_CONFIG
is set, Akyuu.jswon't regenerate the temporary config files.
This may avoid multi-times generation of the config files for
cluster-worker mode.
Checklist
Affected core submodule(s)
config