Improvement for logs in executeScript

This commit is contained in:
Andrii Landiak 2025-01-09 11:10:35 +02:00
parent b5ca7e655f
commit f4372feff9

View File

@ -286,13 +286,13 @@ public abstract class RedisTbTransactionalCache<K extends Serializable, V extend
protected void executeScript(RedisConnection connection, byte[] scriptSha, byte[] luaScript, ReturnType returnType, int numKeys, byte[]... keysAndArgs) {
try {
connection.scriptingCommands().evalSha(scriptSha, returnType, numKeys, keysAndArgs);
} catch (InvalidDataAccessApiUsageException exception) {
log.warn("Loading LUA [{}]", connection.getNativeConnection(), exception);
} catch (InvalidDataAccessApiUsageException ignored) {
log.debug("Loading LUA [{}]", connection.getNativeConnection());
connection.scriptingCommands().scriptLoad(luaScript);
try {
connection.scriptingCommands().evalSha(scriptSha, returnType, numKeys, keysAndArgs);
} catch (InvalidDataAccessApiUsageException ex) {
log.warn("Slowly executing eval instead of fast evalSha", ex);
} catch (InvalidDataAccessApiUsageException exception) {
log.warn("Slowly executing eval instead of fast evalSha", exception);
connection.scriptingCommands().eval(luaScript, returnType, numKeys, keysAndArgs);
}
}