From 1d1c95017e96ea850f19e44ddf1bbd20344abd70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rutkowski?= Date: Sat, 6 Nov 2021 18:27:49 +0100 Subject: [PATCH] Synchronize access to key syncing from cloud change notification (#55) --- Sources/Zephyr.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Zephyr.swift b/Sources/Zephyr.swift index f57a756..74d2da6 100644 --- a/Sources/Zephyr.swift +++ b/Sources/Zephyr.swift @@ -458,8 +458,10 @@ extension Zephyr { return } - for key in monitoredKeys where cloudKeys.contains(key) { - syncSpecificKeys(keys: [key], dataStore: .remote) + zephyrQueue.sync { + for key in monitoredKeys where cloudKeys.contains(key) { + syncSpecificKeys(keys: [key], dataStore: .remote) + } } Zephyr.postNotificationAfterSyncFromCloud()