custom module: prevent reloading the module while the file is being written to

This commit is contained in:
bordun 2020-11-21 18:47:34 +01:00
parent 10937b5c10
commit 7316e85efb
2 changed files with 4 additions and 1 deletions

View file

@ -2,6 +2,9 @@
## 1.7.3
- bug fixes
- custom module: prevent reloading the module while the file is being written to
- widgets
- encoder: add `ticks` property back

View file

@ -65,7 +65,7 @@ class CustomModule {
this.load()
this.watcher = chokidar.watch(this.filename).on('change', ()=>{
this.watcher = chokidar.watch(this.filename, {awaitWriteFinish: {stabilityThreshold: 200}}).on('change', ()=>{
if (this.submodule) {
console.log('(INFO) Submodule changed: ' + this.filename)
this.parent.reload()