(pluginId, pluginState)
| 189 | } |
| 190 | |
| 191 | function markPluginTimedOut(pluginId, pluginState) { |
| 192 | BROKEN_PLUGINS.set(pluginId, { |
| 193 | error: "Plugin load timeout", |
| 194 | timestamp: Date.now(), |
| 195 | }); |
| 196 | |
| 197 | setTimeout(async () => { |
| 198 | try { |
| 199 | if (pluginState.settled || LOADED_PLUGINS.has(pluginId)) return; |
| 200 | await markPluginBroken(pluginId, new Error("Plugin load timeout")); |
| 201 | } catch (error) { |
| 202 | console.error(`Failed to disable timed out plugin ${pluginId}:`, error); |
| 203 | window.log("error", `Failed to disable timed out plugin ${pluginId}:`); |
| 204 | window.log("error", error); |
| 205 | } |
| 206 | }, PLUGIN_DISABLE_TIMEOUT - PLUGIN_LOAD_TIMEOUT); |
| 207 | } |
| 208 | |
| 209 | function updatePluginDisabled(pluginId, disabled) { |
| 210 | const updatePromise = pluginDisabledUpdateQueue |
no test coverage detected