⬆️ Upgrading dependencies. springboot 2.6.10
This commit is contained in:
1 parent
c65cb1e393
commit
62d774d1c9
2 files changed
+5
-16
No files matched your search
+4
-15
@@ -32,6 +32,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import java.util.Collections;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
@@ -123,7 +124,7 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
|
||||
}
|
||||
|
||||
try {
|
||||
if (connection.setNX(key, value)) {
|
||||
if (Boolean.TRUE.equals(connection.setNX(key, value))) {
|
||||
|
||||
if (shouldExpireWithin(ttl)) {
|
||||
connection.pExpire(key, ttl.toMillis());
|
||||
@@ -247,27 +248,16 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
|
||||
|
||||
private <T> T execute(String name, Function<RedisConnection, T> callback) {
|
||||
|
||||
RedisConnection connection = connectionFactory.getConnection();
|
||||
try {
|
||||
|
||||
try (RedisConnection connection = connectionFactory.getConnection()) {
|
||||
checkAndPotentiallyWaitUntilUnlocked(name, connection);
|
||||
return callback.apply(connection);
|
||||
}
|
||||
finally {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void executeLockFree(Consumer<RedisConnection> callback) {
|
||||
|
||||
RedisConnection connection = connectionFactory.getConnection();
|
||||
|
||||
try {
|
||||
try (RedisConnection connection = connectionFactory.getConnection()) {
|
||||
callback.accept(connection);
|
||||
}
|
||||
finally {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAndPotentiallyWaitUntilUnlocked(String name, RedisConnection connection) {
|
||||
@@ -277,7 +267,6 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
while (doCheckLock(name, connection)) {
|
||||
Thread.sleep(sleepTime.toMillis());
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</organization>
|
||||
|
||||
<properties>
|
||||
<spring-boot.version>2.6.9</spring-boot.version>
|
||||
<spring-boot.version>2.6.10</spring-boot.version>
|
||||
<spring-cloud.version>2021.0.3</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.0.1.0</spring-cloud-alibaba.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
Reference in new issue
Block a user