diff options
Diffstat (limited to 'featureClass/featureManager.js')
-rw-r--r-- | featureClass/featureManager.js | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js index 982c106..2c52c7b 100644 --- a/featureClass/featureManager.js +++ b/featureClass/featureManager.js @@ -110,6 +110,18 @@ class FeatureManager { if (this.isDev) { this.registerStep(true, 2, () => { + + key = this.watchService.take(); + let moduleToReload = this.watches[key] + if (this.features[moduleToReload] && !this.reloadingModules.includes(moduleToReload)) { //if enabled && not alr in queue + this.reloadingModules.push(moduleToReload) + this.reloadModuleTime = Date.now() + 5000 + } + key.pollEvents()/*.forEach(event=>{ + console.log(event.context().toString()) + })*/ + key.reset(); + if (this.reloadModuleTime !== 0 && Date.now() - this.reloadModuleTime > 0) { new Thread(() => { this.reloadModuleTime = 0 @@ -129,20 +141,6 @@ class FeatureManager { this.watchService = Java.type("java.nio.file.FileSystems").getDefault().newWatchService(); this.reloadingModules = [] this.reloadModuleTime = 0 - new Thread(() => { - while (this.enabled) { - key = this.watchService.take(); - let moduleToReload = this.watches[key] - if (this.features[moduleToReload] && !this.reloadingModules.includes(moduleToReload)) { //if enabled && not alr in queue - this.reloadingModules.push(moduleToReload) - this.reloadModuleTime = Date.now() + 5000 - } - key.pollEvents()/*.forEach(event=>{ - console.log(event.context().toString()) - })*/ - key.reset(); - } - }).start() } this.registerCommand("soopyunloadfeature", (args) => { |