mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-27 11:35:23 -07:00
fix(plugins): unload late-loading plugins before quit teardown
- unloadAll waits for an in-progress load so plugins still activating get deactivated too - One 2 s budget covers the load wait and all deactivates - Quit cleanup awaits plugin unload before any other teardown - Force-quit timer now allows the plugin budget plus 2 s
This commit is contained in:
6 files changed
+92
-24
No files matched your search
@@ -67,7 +67,7 @@ A plugin folder needs a `plugin.json`:
|
||||
{ "name": "My Plugin", "version": "1.0.0", "main": "main.js" }
|
||||
```
|
||||
|
||||
`main` points to a CommonJS module (`.js`) or an ES module (`.mjs`) that exports `activate(ctx)`. It may return a cleanup function, or the module can export `deactivate()`. On quit, SubMiner waits up to 3 seconds for it, including any promise it returns. Everything a plugin registers through `ctx` (listeners, timers, actions, panels, running programs) is cleaned up automatically when SubMiner quits.
|
||||
`main` points to a CommonJS module (`.js`) or an ES module (`.mjs`) that exports `activate(ctx)`. It may return a cleanup function, or the module can export `deactivate()`. On quit, SubMiner waits up to 2 seconds for it, including any promise it returns. Everything a plugin registers through `ctx` (listeners, timers, actions, panels, running programs) is cleaned up automatically when SubMiner quits.
|
||||
|
||||
```js
|
||||
function activate(ctx) {
|
||||
|
||||
Reference in new issue
Block a user