MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / saveDynamicFeatures

Method saveDynamicFeatures

src/main/api/plugin/feature.ts:187–206  ·  view source on GitHub ↗

* 保存动态 features 到数据库

(pluginName: string, features: DynamicFeature[])

Source from the content-addressed store, hash-verified

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 * 通知渲染进程插件列表已变化(带防抖处理)

Callers 2

setupIPCMethod · 0.95

Calls 4

stringifyMethod · 0.80
getMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected