Skip to content

Commit

Permalink
#247 SET command uses milliseconds PX instead of seconds EX
Browse files Browse the repository at this point in the history
  • Loading branch information
KarelCemus committed Feb 11, 2022
1 parent 64c87cd commit 2f3dc4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

## Changelog

### [:link: 2.7.0](https://github.com/KarelCemus/play-redis/tree/2.7.0)

SET command supports milliseconds, previous versions used seconds [#247](https://github.com/KarelCemus/play-redis/issues/247)

Added support for sorted sets ZSET [#259](https://github.com/KarelCemus/play-redis/pull/259)

### [:link: 2.6.1](https://github.com/KarelCemus/play-redis/tree/2.6.1)

Support of `DEL` operation in redis cluster [#230](https://github.com/KarelCemus/play-redis/issues/230)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ private[connector] class RedisConnectorImpl(serializer: AkkaSerializer, redis: R
redis.set(
key,
value,
exSeconds = if (expiration.isFinite) Some(expiration.toSeconds) else None,
pxMilliseconds = if (expiration.isFinite) Some(expiration.toMillis) else None,
NX = ifNotExists
) executing "SET" withKey key andParameters s"$value${s" EX $expiration" when expiration.isFinite}${" NX" when ifNotExists}" logging {
case true if expiration.isFinite => log.debug(s"Set on key '$key' for ${expiration.toSeconds} seconds.")
) executing "SET" withKey key andParameters s"$value${s" PX $expiration" when expiration.isFinite}${" NX" when ifNotExists}" logging {
case true if expiration.isFinite => log.debug(s"Set on key '$key' for ${expiration.toMillis} milliseconds.")
case true => log.debug(s"Set on key '$key' for infinite seconds.")
case false => log.debug(s"Set on key '$key' ignored. Condition was not met.")
}
Expand Down

0 comments on commit 2f3dc4f

Please sign in to comment.