diff --git a/pom.xml b/pom.xml
index 6e446970fc..6b1af3544d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.springframework.data
spring-data-redis
- 2.2.0.BUILD-SNAPSHOT
+ 2.2.0.DATAREDIS-1031-SNAPSHOT
Spring Data Redis
diff --git a/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java
index 6dc48b20a6..0d81a533fb 100644
--- a/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java
@@ -131,7 +131,7 @@ default Mono> keys(ByteBuffer pattern) {
* Find all keys matching the given {@literal pattern}.
* It is recommended to use {@link #scan(ScanOptions)} to iterate over the keyspace as {@link #keys(Publisher)} is a
* non-interruptible and expensive Redis operation.
- *
+ *
* @param patterns must not be {@literal null}.
* @return
* @see Redis Documentation: KEYS
@@ -462,7 +462,7 @@ default Mono pExpire(ByteBuffer key, Duration timeout) {
Assert.notNull(key, "Key must not be null!");
Assert.notNull(timeout, "Timeout must not be null!");
- return expire(Mono.just(new ExpireCommand(key, timeout))).next().map(BooleanResponse::getOutput);
+ return pExpire(Mono.just(new ExpireCommand(key, timeout))).next().map(BooleanResponse::getOutput);
}
/**
diff --git a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java
index 3b811b0dc6..d6b9ca1b06 100644
--- a/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java
+++ b/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommands.java
@@ -262,7 +262,7 @@ public Flux> pExpire(Publisher com
Assert.notNull(command.getKey(), "Key must not be null!");
Assert.notNull(command.getTimeout(), "Timeout must not be null!");
- return cmd.pexpire(command.getKey(), command.getTimeout().getSeconds())
+ return cmd.pexpire(command.getKey(), command.getTimeout().toMillis())
.map(value -> new BooleanResponse<>(command, value));
}));
}
@@ -294,7 +294,7 @@ public Flux> pExpireAt(Publisher new BooleanResponse<>(command, value));
}));
}
diff --git a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommandsTests.java b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommandsTests.java
index 4955284292..bef4435dfc 100644
--- a/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommandsTests.java
+++ b/src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveKeyCommandsTests.java
@@ -278,7 +278,7 @@ public void shouldExpireKeysCorrectly() {
assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8L);
}
- @Test // DATAREDIS-602
+ @Test // DATAREDIS-602, DATAREDIS-1031
public void shouldPreciseExpireKeysCorrectly() {
nativeCommands.set(KEY_1, VALUE_1);
@@ -288,10 +288,10 @@ public void shouldPreciseExpireKeysCorrectly() {
.expectComplete() //
.verify();
- assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8L);
+ assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8).isLessThan(11);
}
- @Test // DATAREDIS-602
+ @Test // DATAREDIS-602, DATAREDIS-1031
public void shouldExpireAtKeysCorrectly() {
nativeCommands.set(KEY_1, VALUE_1);
@@ -302,10 +302,10 @@ public void shouldExpireAtKeysCorrectly() {
.expectComplete() //
.verify();
- assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8L);
+ assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8).isLessThan(11);
}
- @Test // DATAREDIS-602
+ @Test // DATAREDIS-602, DATAREDIS-1031
public void shouldPreciseExpireAtKeysCorrectly() {
nativeCommands.set(KEY_1, VALUE_1);
@@ -316,7 +316,7 @@ public void shouldPreciseExpireAtKeysCorrectly() {
.expectComplete() //
.verify();
- assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8L);
+ assertThat(nativeCommands.ttl(KEY_1)).isGreaterThan(8).isLessThan(11);
}
@Test // DATAREDIS-602