优化同步服务逻辑

pull/1583/head
lyswhut 2023-08-29 17:46:16 +08:00
parent 03f322f92a
commit 0d5e880fb2
1 changed files with 2 additions and 1 deletions

View File

@ -9,9 +9,10 @@ let unregisterLocalListAction: (() => void) | null
const sendListAction = async(wss: LX.Sync.Server.SocketServer, action: LX.Sync.List.ActionList) => {
// console.log('sendListAction', action.action)
const userSpace = getUserSpace()
const key = await userSpace.listManage.createSnapshot()
let key = ''
for (const client of wss.clients) {
if (!client.moduleReadys?.list) continue
if (!key) key = await userSpace.listManage.createSnapshot()
void client.remoteQueueList.onListSyncAction(action).then(async() => {
return userSpace.listManage.updateDeviceSnapshotKey(client.keyInfo.clientId, key)
}).catch(err => {