* 保存动态 features 到数据库
(pluginName: string, features: DynamicFeature[])
| 185 | * 保存动态 features 到数据库 |
| 186 | */ |
| 187 | private saveDynamicFeatures(pluginName: string, features: DynamicFeature[]): void { |
| 188 | const key = this.getDynamicFeaturesDocId(pluginName) |
| 189 | const existing = lmdbInstance.get(key) |
| 190 | console.log('[PluginFeature] 保存动态 Feature 到隔离命名空间:', { |
| 191 | pluginName, |
| 192 | key, |
| 193 | featureCount: features.length |
| 194 | }) |
| 195 | |
| 196 | const doc: any = { |
| 197 | _id: key, |
| 198 | data: JSON.stringify({ features }) |
| 199 | } |
| 200 | |
| 201 | if (existing) { |
| 202 | doc._rev = existing._rev |
| 203 | } |
| 204 | |
| 205 | lmdbInstance.put(doc) |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * 通知渲染进程插件列表已变化(带防抖处理) |
no test coverage detected