From 2e55442df76612600ba8fc7c90a1d3b8bc6c8895 Mon Sep 17 00:00:00 2001 From: Fady Matar Date: Tue, 13 Aug 2024 00:35:13 -0700 Subject: [PATCH] Replaced `ProfileManager` with `ConfigUtils` to check active profiles. (#812) * Replaced `ProfileManager` with `ConfigUtils` to check active profiles. * Removed useless statement --------- Co-authored-by: Fady Matar Co-authored-by: Fady Matar --- .../langchain4j/pgvector/PgVectorAgroalPoolInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/embedding-stores/pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorAgroalPoolInterceptor.java b/embedding-stores/pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorAgroalPoolInterceptor.java index 340cf3d7f..e667618ee 100644 --- a/embedding-stores/pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorAgroalPoolInterceptor.java +++ b/embedding-stores/pgvector/runtime/src/main/java/io/quarkiverse/langchain4j/pgvector/PgVectorAgroalPoolInterceptor.java @@ -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 @@ -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);