presets: only watch file in non-test environment
This commit is contained in:
parent
ec85efe107
commit
92c20bf61c
@ -300,12 +300,14 @@ export default class AccessControlPreset extends IPreset {
|
||||
const aclPath = path.resolve(process.cwd(), acl);
|
||||
// note: should load rules once server up
|
||||
reloadRules(aclPath);
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
fs.watchFile(aclPath, (curr, prev) => {
|
||||
if (curr.mtime > prev.mtime) {
|
||||
reloadRules(aclPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
constructor({acl, max_tries = DEFAULT_MAX_TRIES}) {
|
||||
super();
|
||||
|
Loading…
Reference in New Issue
Block a user