From 5071dc4d68646b70ba8503d8ca5eb0939eba96b7 Mon Sep 17 00:00:00 2001 From: arifBurakDemiray Date: Thu, 21 Sep 2023 16:10:44 +0300 Subject: [PATCH] feat: new way of storage init --- .../main/java/ly/count/sdk/java/internal/SDKStorage.java | 3 +-- .../src/main/java/ly/count/sdk/java/internal/Storage.java | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/SDKStorage.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/SDKStorage.java index 415c31d25..885764fbd 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/SDKStorage.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/SDKStorage.java @@ -21,10 +21,8 @@ public class SDKStorage { private Log L; private CtxCore ctx; - private static final String FILE_NAME_PREFIX = "[CLY]"; private static final String FILE_NAME_SEPARATOR = "_"; - private static final String EVENT_QUEUE_FILE_NAME = "event_queue"; protected SDKStorage() { @@ -34,6 +32,7 @@ protected SDKStorage() { public void init(CtxCore ctx, Log logger) { this.L = logger; this.ctx = ctx; + Storage.init(); } public void stop(ly.count.sdk.java.internal.CtxCore ctx, boolean clear) { diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/Storage.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/Storage.java index b8d59081b..4bbc0a20d 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/Storage.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/Storage.java @@ -1,7 +1,5 @@ package ly.count.sdk.java.internal; -import java.util.Collections; -import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -15,7 +13,11 @@ public class Storage { - private static final Tasks tasks = new Tasks("storage", null); + private static Tasks tasks; + + static void init() { + tasks = new Tasks("storage", null); + } public static String name(Storable storable) { return storable.storagePrefix() + "_" + storable.storageId();