Skip to content

Commit

Permalink
feature: report library version with Jedis' JedisClientConfig#clientS…
Browse files Browse the repository at this point in the history
…etInfoConfig
  • Loading branch information
bsbodden committed Jun 22, 2024
1 parent 1f2591a commit c2894ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
prefix = "redis.om.spring", ignoreInvalidFields = true
)
public class RedisOMProperties {
public static final String ROMS_VERSION = "0.9.3-SNAPSHOT";
public static final int MAX_SEARCH_RESULTS = 10000;
public static final double DEFAULT_DISTANCE = 0.0005;
public static final Metrics DEFAULT_DISTANCE_METRIC = Metrics.MILES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.redis.om.spring.client;

import com.google.gson.GsonBuilder;
import com.redis.om.spring.RedisOMProperties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.data.redis.connection.RedisNode;
Expand Down Expand Up @@ -132,9 +133,11 @@ private JedisClientConfig createClientConfig(int database, @Nullable String user
clientConfiguration.getClientName().ifPresent(jedisConfigBuilder::clientName);
jedisConfigBuilder.connectionTimeoutMillis(Math.toIntExact(clientConfiguration.getConnectTimeout().toMillis()));
jedisConfigBuilder.socketTimeoutMillis(Math.toIntExact(clientConfiguration.getReadTimeout().toMillis()));

jedisConfigBuilder.database(database);

jedisConfigBuilder.clientSetInfoConfig(
ClientSetInfoConfig.withLibNameSuffix("redis-om-spring_v" + RedisOMProperties.ROMS_VERSION));

if (!ObjectUtils.isEmpty(username)) {
jedisConfigBuilder.user(username);
}
Expand Down

0 comments on commit c2894ef

Please sign in to comment.