From 48f916f605a55ffbd168bc4a111451b10b7bb058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Wed, 17 Jan 2024 12:34:06 +0100 Subject: [PATCH] Add emitter configuration properties to coder and copying --- .../Snowplow/Configurations/EmitterConfiguration.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sources/Snowplow/Configurations/EmitterConfiguration.swift b/Sources/Snowplow/Configurations/EmitterConfiguration.swift index a6d09ba27..8e2b634e5 100644 --- a/Sources/Snowplow/Configurations/EmitterConfiguration.swift +++ b/Sources/Snowplow/Configurations/EmitterConfiguration.swift @@ -315,6 +315,8 @@ public class EmitterConfiguration: SerializableConfiguration, EmitterConfigurati copy.serverAnonymisation = serverAnonymisation copy.eventStore = eventStore copy.retryFailedRequests = retryFailedRequests + copy.maxEventStoreAge = maxEventStoreAge + copy.maxEventStoreSize = maxEventStoreSize return copy } @@ -333,6 +335,8 @@ public class EmitterConfiguration: SerializableConfiguration, EmitterConfigurati coder.encode(customRetryForStatusCodes, forKey: "customRetryForStatusCodes") coder.encode(serverAnonymisation, forKey: "serverAnonymisation") coder.encode(retryFailedRequests, forKey: "retryFailedRequests") + coder.encode(maxEventStoreAge, forKey: "maxEventStoreAge") + coder.encode(maxEventStoreSize, forKey: "maxEventStoreSize") } required init?(coder: NSCoder) { @@ -351,5 +355,11 @@ public class EmitterConfiguration: SerializableConfiguration, EmitterConfigurati if coder.containsValue(forKey: "retryFailedRequests") { retryFailedRequests = coder.decodeBool(forKey: "retryFailedRequests") } + if coder.containsValue(forKey: "maxEventStoreAge") { + maxEventStoreAge = coder.decodeDouble(forKey: "maxEventStoreAge") + } + if coder.containsValue(forKey: "maxEventStoreSize") { + maxEventStoreSize = coder.decodeInt64(forKey: "maxEventStoreSize") + } } }