Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cicd test #216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ static void initPool(Start start, boolean shouldWait, PostConnectCallback postCo
}
}

static void resetPool(Start start) {
if (!isAlreadyInitialised(start)) {
return;
}

ConnectionPool currentPool = (ConnectionPool) start.getResourceDistributor().getResource(RESOURCE_KEY);
start.getResourceDistributor().removeResource(RESOURCE_KEY);
currentPool.hikariDataSource.close();
}

public static Connection getConnection(Start start) throws SQLException, StorageQueryException {
if (getInstance(start) == null) {
throw new IllegalStateException("Please call initPool before getConnection");
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/supertokens/storage/postgresql/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ public void initStorage(boolean shouldWait, List<TenantIdentifier> tenantIdentif
}
}

@Override
public void resetConnectionPoolForReinitWithAllTenantsForBaseStorage() {
ConnectionPool.resetPool(this);
}

@Override
public <T> T startTransaction(TransactionLogic<T> logic)
throws StorageTransactionLogicException, StorageQueryException {
Expand Down
Loading