зеркало из https://github.com/microsoft/statsd.git
Adding a config option, automaticConfigReload, controlling the behaviour of the config file reloading feature.
This commit is contained in:
Родитель
de7a7bf009
Коммит
8c7add809d
|
@ -99,6 +99,8 @@ Optional Variables:
|
|||
[ { metric: 'foo', bins: [] },
|
||||
{ metric: '', bins: [ 50, 100, 150, 200, 'inf'] } ]
|
||||
|
||||
automaticConfigReload: whether to watch the config file and reload it when it
|
||||
changes. The default is true. Set this to false to disable.
|
||||
*/
|
||||
{
|
||||
graphitePort: 2003
|
||||
|
|
|
@ -24,7 +24,9 @@ var Configurator = function (file) {
|
|||
this.updateConfig();
|
||||
|
||||
fs.watch(file, function (event, filename) {
|
||||
if (event == 'change') { self.updateConfig(); }
|
||||
if (event == 'change' && self.config.automaticConfigReload != false) {
|
||||
self.updateConfig();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче