From fd9c74a285ad2c51ef29773aa77857db3448c812 Mon Sep 17 00:00:00 2001 From: dgpetrie Date: Thu, 21 Feb 2019 16:53:39 -0500 Subject: [PATCH] Allow 64bit ints for TTL in client. Redis server supports 64 bit ints for TTL. Actually up to 0x7FFFFFFFFFFFFFFFLL milliseconds. Or 0x7FFFFFFFFFFFFFFFLL/1000 seconds. --- includes/cpp_redis/core/client.hpp | 8 ++++---- sources/core/client.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/cpp_redis/core/client.hpp b/includes/cpp_redis/core/client.hpp index 70f90a78..7c5be62e 100644 --- a/includes/cpp_redis/core/client.hpp +++ b/includes/cpp_redis/core/client.hpp @@ -1151,9 +1151,9 @@ namespace cpp_redis { std::future ping(const std::string &message); client & - psetex(const std::string &key, int ms, const std::string &val, const reply_callback_t &reply_callback); + psetex(const std::string &key, int64_t ms, const std::string &val, const reply_callback_t &reply_callback); - std::future psetex(const std::string &key, int ms, const std::string &val); + std::future psetex(const std::string &key, int64_t ms, const std::string &val); client &publish(const std::string &channel, const std::string &message, const reply_callback_t &reply_callback); @@ -1307,9 +1307,9 @@ namespace cpp_redis { std::future setbit_(const std::string &key, int offset, const std::string &value); client & - setex(const std::string &key, int seconds, const std::string &value, const reply_callback_t &reply_callback); + setex(const std::string &key, int64_t seconds, const std::string &value, const reply_callback_t &reply_callback); - std::future setex(const std::string &key, int seconds, const std::string &value); + std::future setex(const std::string &key, int64_t seconds, const std::string &value); client &setnx(const std::string &key, const std::string &value, const reply_callback_t &reply_callback); diff --git a/sources/core/client.cpp b/sources/core/client.cpp index 1c582764..4638fc1a 100644 --- a/sources/core/client.cpp +++ b/sources/core/client.cpp @@ -1694,7 +1694,7 @@ namespace cpp_redis { } client & - client::psetex(const std::string &key, int ms, const std::string &val, + client::psetex(const std::string &key, int64_t ms, const std::string &val, const reply_callback_t &reply_callback) { send({"PSETEX", key, std::to_string(ms), val}, reply_callback); return *this; @@ -1967,7 +1967,7 @@ namespace cpp_redis { } client & - client::setex(const std::string &key, int seconds, const std::string &value, const reply_callback_t &reply_callback) { + client::setex(const std::string &key, int64_t seconds, const std::string &value, const reply_callback_t &reply_callback) { send({"SETEX", key, std::to_string(seconds), value}, reply_callback); return *this; } @@ -4020,7 +4020,7 @@ namespace cpp_redis { } std::future - client::psetex(const std::string &key, int ms, const std::string &val) { + client::psetex(const std::string &key, int64_t ms, const std::string &val) { return exec_cmd([=](const reply_callback_t &cb) -> client & { return psetex(key, ms, val, cb); }); } @@ -4199,7 +4199,7 @@ namespace cpp_redis { } std::future - client::setex(const std::string &key, int seconds, const std::string &value) { + client::setex(const std::string &key, int64_t seconds, const std::string &value) { return exec_cmd([=](const reply_callback_t &cb) -> client & { return setex(key, seconds, value, cb); }); }