Skip to content

Commit

Permalink
Replaced ProfileManager with ConfigUtils to check active profile…
Browse files Browse the repository at this point in the history
…s. (#812)

* Replaced `ProfileManager` with `ConfigUtils` to check active profiles.

* Removed useless statement

---------

Co-authored-by: Fady Matar <[email protected]>
Co-authored-by: Fady Matar <[email protected]>
  • Loading branch information
3 people authored Aug 13, 2024
1 parent 7e0fdfb commit 2e55442
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.pgvector.PGvector;

import io.agroal.api.AgroalPoolInterceptor;
import io.quarkus.runtime.configuration.ProfileManager;
import io.quarkus.runtime.configuration.ConfigUtils;

/**
* PgVectorAgroalPoolInterceptor intercept connection creation and add needed settings for pgvector
Expand All @@ -17,7 +17,7 @@ public class PgVectorAgroalPoolInterceptor implements AgroalPoolInterceptor {
@Override
public void onConnectionCreate(Connection connection) {
try (Statement statement = connection.createStatement()) {
if (ProfileManager.getLaunchMode().isDevOrTest()) {
if (ConfigUtils.isProfileActive("dev") || ConfigUtils.isProfileActive("test")) {
statement.executeUpdate("CREATE EXTENSION IF NOT EXISTS vector");
}
PGvector.addVectorType(connection);
Expand Down

0 comments on commit 2e55442

Please sign in to comment.