Skip to content
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

Closed

Conversation

XadillaX
Copy link
Contributor

@XadillaX XadillaX commented Jul 12, 2017

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.

Checklist
Affected core submodule(s)

config

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.
@mapleincode
Copy link
Collaborator

@XadillaX 其实感觉这个机制 如果目录 & js & json 重名 不是会覆盖配置文件么

@XadillaX
Copy link
Contributor Author

@mapleincode 只会遍历目录,忽略文件。

}
}
}

process.env.NODE_CONFIG_DIR = currentDir;
Copy link
Collaborator

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;?

Copy link
Contributor Author

@XadillaX XadillaX Jul 13, 2017

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

XadillaX added a commit that referenced this pull request Jul 28, 2017
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>
@XadillaX
Copy link
Contributor Author

Landed in 2b08b17

@XadillaX XadillaX closed this Jul 28, 2017
XadillaX added a commit that referenced this pull request Jul 28, 2017
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>
@XadillaX XadillaX mentioned this pull request Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants