Skip to content

Commit

Permalink
feat: storage init
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Sep 21, 2023
1 parent 444c5a0 commit 5a50040
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package ly.count.sdk.java.internal;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.channels.FileLock;
Expand All @@ -32,6 +30,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) {
Expand Down Expand Up @@ -302,7 +301,7 @@ protected String readEventQueue() {

String eventQueue = "";

try {
try {
eventQueue = Utils.readFileContent(file);
} catch (IOException e) {
// Handle the error if reading fails
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit 5a50040

Please sign in to comment.