MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / saveSyncConfig

Method saveSyncConfig

src/main/core/sync/syncEngine.ts:86–95  ·  view source on GitHub ↗

* 保存同步配置

(config: SyncConfig)

Source from the content-addressed store, hash-verified

84 * 保存同步配置
85 */
86 async saveSyncConfig(config: SyncConfig): Promise<void> {
87 // 先获取现有文档以获得 _rev
88 const existingDoc = await this.db.promises.get('SYNC/config')
89
90 await this.db.promises.put({
91 _id: 'SYNC/config',
92 _rev: existingDoc?._rev, // 保留现有的 _rev
93 data: config
94 })
95 }
96
97 /**
98 * 启动自动同步

Callers 2

updateLastSyncTimeMethod · 0.95
setupIPCMethod · 0.80

Calls 2

getMethod · 0.65
putMethod · 0.45

Tested by

no test coverage detected