From 21e660930dcfeacf6cdebccf2659cf05a45f9251 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Fri, 19 Apr 2024 15:29:07 +0530 Subject: [PATCH] fix: test --- src/main/java/io/supertokens/Main.java | 11 +++-------- src/main/java/io/supertokens/inmemorydb/Start.java | 5 +++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/supertokens/Main.java b/src/main/java/io/supertokens/Main.java index 6ec44b7d8..6736e23de 100644 --- a/src/main/java/io/supertokens/Main.java +++ b/src/main/java/io/supertokens/Main.java @@ -209,14 +209,9 @@ private void init() throws IOException, StorageQueryException { // load all configs for each of the tenants. MultitenancyHelper.getInstance(this).loadConfig(new ArrayList<>()); - if (!StorageLayer.isInMemDb(this)) { - // we want to load storage layer once again so that the base storage also contains the right - // tenant identifier set passed to the init. So we close the base storage layer and also clear - // all the resources for storage layer - StorageLayer.getBaseStorage(this).stopLogging(); - StorageLayer.getBaseStorage(this).close(); - this.getResourceDistributor().clearAllResourcesWithResourceKey(StorageLayer.RESOURCE_KEY); - } + // we want to load storage layer once again so that the base storage also contains the right + // tenant identifier set passed to the init. So we call the resetPostConnectCallbackForBaseTenantStorage. + StorageLayer.getBaseStorage(this).resetPostConnectCallbackForBaseTenantStorage(); MultitenancyHelper.getInstance(this).loadStorageLayer(); } catch (InvalidConfigException e) { diff --git a/src/main/java/io/supertokens/inmemorydb/Start.java b/src/main/java/io/supertokens/inmemorydb/Start.java index 4f12d860b..e285d43fe 100644 --- a/src/main/java/io/supertokens/inmemorydb/Start.java +++ b/src/main/java/io/supertokens/inmemorydb/Start.java @@ -187,6 +187,11 @@ public void initStorage(boolean shouldWait, List tenantIdentif } } + @Override + public void resetPostConnectCallbackForBaseTenantStorage() { + // no op + } + @Override public T startTransaction(TransactionLogic logic) throws StorageTransactionLogicException, StorageQueryException {