Skip to content

Commit 6531e59

Browse files
committed
DATAREDIS-1195 - Polishing.
Simplify Expiration.from(…) construction. Original pull request: #553.
1 parent f19f336 commit 6531e59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ public byte[] putIfAbsent(String name, byte[] key, byte[] value, @Nullable Durat
130130
try {
131131

132132
boolean put;
133+
133134
if (shouldExpireWithin(ttl)) {
134-
put = connection.set(key, value, Expiration.milliseconds(ttl.toMillis()), SetOption.ifAbsent());
135+
put = connection.set(key, value, Expiration.from(ttl), SetOption.ifAbsent());
135136
} else {
136137
put = connection.setNX(key, value);
137138
}

0 commit comments

Comments
 (0)