Fix watching registration file before creation
This commit is contained in:
@@ -78,10 +78,14 @@ function readRegistration() {
|
|||||||
/** @type {import("../types").AppServiceRegistrationConfig} */ // @ts-ignore
|
/** @type {import("../types").AppServiceRegistrationConfig} */ // @ts-ignore
|
||||||
let reg = readRegistration()
|
let reg = readRegistration()
|
||||||
|
|
||||||
fs.watch(registrationFilePath, {persistent: false}, () => {
|
if (reg) {
|
||||||
let newReg = readRegistration()
|
fs.watch(registrationFilePath, {persistent: false}, () => {
|
||||||
Object.assign(reg, newReg)
|
let newReg = readRegistration()
|
||||||
})
|
if (newReg) {
|
||||||
|
Object.assign(reg, newReg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports.registrationFilePath = registrationFilePath
|
module.exports.registrationFilePath = registrationFilePath
|
||||||
module.exports.readRegistration = readRegistration
|
module.exports.readRegistration = readRegistration
|
||||||
|
|||||||
Reference in New Issue
Block a user