Skip to content

Commit

Permalink
fix: quiet down custom-devices-related logs (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdbogen authored Aug 28, 2020
1 parent 2b46b3a commit 7aa06e0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ const watch = (filename, fn) => {
} catch {
watchers.set(
filename,
fs.watch(path.dirname(filename), () => {
watchers.get(filename).close()
watch(filename, fn)
fn()
fs.watch(path.dirname(filename), (e, f) => {
if (!f || f === 'customDevices.js' || f === 'customDevices.json') {
watchers.get(filename).close()
watch(filename, fn)
fn()
}
})
)
}
Expand All @@ -74,7 +76,6 @@ const loadCustomDevices = () => {
loaded = customDevicesJsonPath
devices = JSON.parse(fs.readFileSync(loaded))
} else {
debug('no custom devices sources found')
return
}
} catch (error) {
Expand Down

0 comments on commit 7aa06e0

Please sign in to comment.