fix: (regression 0.42.2) all plugin reloaded when one is started or stopped

Massimo Melina committed Apr 10, 2023 at 10:34 UTC f2964684152a19d817686ca6c91430db92113357
2 files changed +3 -2
src/misc.ts
+1 -1
@@ -11,7 +11,7 @@ export * from './util-generators'
11 export * from './util-files'
12 import debounceAsync from './debounceAsync'
13 import { Readable } from 'stream'
14 -import { isMatch, matcher } from 'micromatch'
14 +import { matcher } from 'micromatch'
15 import cidr from 'cidr-tools'
16 export { debounceAsync }
17
src/plugins.ts
+2 -1
@@ -226,7 +226,8 @@ export async function rescan() {
226 if (found.includes(id)) // not twice
227 continue
228 found.push(id)
229 - loadPlugin(id, f)
229 + if (!plugins[id]) // already loaded
230 + loadPlugin(id, f)
231 }
232 for (const [id,p] of Object.entries(foundDisabled)) {
233 const a = availablePlugins[id]