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