mirror of
https://github.com/koush/scrypted.git
synced 2026-02-28 08:22:29 +00:00
server: Fix bug where mixins are not invalidated after a plugin restart fails, and then later succeeds.
This commit is contained in:
@@ -80,8 +80,7 @@ export class PluginHost {
|
||||
}
|
||||
this.ws = {};
|
||||
|
||||
const deviceIds = new Set<string>(Object.values(this.scrypted.pluginDevices).filter(d => d.pluginId === this.pluginId).map(d => d._id));
|
||||
this.scrypted.invalidateMixins(deviceIds);
|
||||
this.scrypted.invalidatePluginMixins(this.pluginId);
|
||||
|
||||
this.consoleServer.then(server => server.destroy());
|
||||
}
|
||||
|
||||
@@ -463,6 +463,7 @@ export class ScryptedRuntime extends PluginHttp<HttpPluginData> {
|
||||
delete this.plugins[pluginId];
|
||||
existing.kill();
|
||||
}
|
||||
this.invalidatePluginMixins(pluginId);
|
||||
}
|
||||
|
||||
// should this be async?
|
||||
@@ -483,6 +484,11 @@ export class ScryptedRuntime extends PluginHttp<HttpPluginData> {
|
||||
return proxyPair;
|
||||
}
|
||||
|
||||
invalidatePluginMixins(pluginId: string) {
|
||||
const deviceIds = new Set<string>(Object.values(this.pluginDevices).filter(d => d.pluginId === pluginId).map(d => d._id));
|
||||
this.invalidateMixins(deviceIds);
|
||||
}
|
||||
|
||||
invalidateMixins(ids: Set<string>) {
|
||||
const ret = new Set<string>();
|
||||
const remaining = [...ids];
|
||||
|
||||
Reference in New Issue
Block a user