Skip to content

Commit 17d05c8

Browse files
authored
fix: fix for sqlite (#984)
1 parent 9f26045 commit 17d05c8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/main/java/io/supertokens/Main.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,14 @@ private void init() throws IOException, StorageQueryException {
209209
// load all configs for each of the tenants.
210210
MultitenancyHelper.getInstance(this).loadConfig(new ArrayList<>());
211211

212-
// we want to load storage layer once again so that the base storage also contains the right
213-
// tenant identifier set passed to the init. So we close the base storage layer and also clear
214-
// all the resources for storage layer
215-
StorageLayer.getBaseStorage(this).stopLogging();
216-
StorageLayer.getBaseStorage(this).close();
217-
this.getResourceDistributor().clearAllResourcesWithResourceKey(StorageLayer.RESOURCE_KEY);
212+
if (!StorageLayer.isInMemDb(this)) {
213+
// we want to load storage layer once again so that the base storage also contains the right
214+
// tenant identifier set passed to the init. So we close the base storage layer and also clear
215+
// all the resources for storage layer
216+
StorageLayer.getBaseStorage(this).stopLogging();
217+
StorageLayer.getBaseStorage(this).close();
218+
this.getResourceDistributor().clearAllResourcesWithResourceKey(StorageLayer.RESOURCE_KEY);
219+
}
218220

219221
MultitenancyHelper.getInstance(this).loadStorageLayer();
220222
} catch (InvalidConfigException e) {

0 commit comments

Comments
 (0)