@@ -92,9 +92,10 @@ struct DB {
9292
9393struct Prefix {
9494 constexpr static auto rule = LEXY_LIT(" prefix=" ) >>
95- dsl::capture (dsl::token(dsl::identifier(
96- dsl::ascii::alpha_underscore,
97- dsl::ascii::alpha_digit_underscore)));
95+ dsl::capture (dsl::token(
96+ dsl::identifier (
97+ dsl::ascii::alpha_underscore,
98+ dsl::ascii::alpha_digit_underscore)));
9899 constexpr static auto value =
99100 lexy::callback<PrefixOpt>([](auto && str) -> PrefixOpt {
100101 return PrefixOpt{std::string (str.data (), str.size ())};
@@ -263,8 +264,9 @@ void RedisV1::StartThread() {
263264void RedisV1::HeartBeat (redis::ContextPtr& connection) {
264265 for (uint32_t retry = 0 ; retry < opt_.retry_limit_ ; ++retry) {
265266 try {
266- auto reply = redis::ReplyPtr (reinterpret_cast <redisReply*>(
267- redisCommand (connection.get (), " PING" )));
267+ auto reply = redis::ReplyPtr (
268+ reinterpret_cast <redisReply*>(
269+ redisCommand (connection.get (), " PING" )));
268270 TORCH_CHECK (
269271 reply && reply->type == REDIS_REPLY_STRING,
270272 " Ping should return string" );
@@ -283,7 +285,7 @@ redis::ContextPtr RedisV1::Connect() const {
283285 connection =
284286 redis::ContextPtr (redisConnect (opt_.host_ .c_str (), opt_.port_ ));
285287 } else {
286- struct timeval interval {};
288+ struct timeval interval{};
287289 interval.tv_sec = opt_.timeout_ms_ / 1000 ;
288290 interval.tv_usec = opt_.timeout_ms_ % 1000 * 1000 ;
289291 connection = redis::ContextPtr (
@@ -299,21 +301,24 @@ redis::ContextPtr RedisV1::Connect() const {
299301 if (!opt_.password_ .empty ()) {
300302 redis::ReplyPtr reply;
301303 if (opt_.username_ .empty ()) {
302- reply = redis::ReplyPtr (reinterpret_cast <redisReply*>(
303- redisCommand (connection.get (), " AUTH %s" , opt_.password_ .c_str ())));
304+ reply = redis::ReplyPtr (
305+ reinterpret_cast <redisReply*>(redisCommand (
306+ connection.get (), " AUTH %s" , opt_.password_ .c_str ())));
304307 } else {
305- reply = redis::ReplyPtr (reinterpret_cast <redisReply*>(redisCommand (
306- connection.get (),
307- " AUTH %s %s" ,
308- opt_.username_ .c_str (),
309- opt_.password_ .c_str ())));
308+ reply = redis::ReplyPtr (
309+ reinterpret_cast <redisReply*>(redisCommand (
310+ connection.get (),
311+ " AUTH %s %s" ,
312+ opt_.username_ .c_str (),
313+ opt_.password_ .c_str ())));
310314 }
311315 CheckStatus (" auth error" , connection, reply);
312316 }
313317
314318 if (opt_.db_ != 0 ) {
315- auto reply = redis::ReplyPtr (reinterpret_cast <redisReply*>(
316- redisCommand (connection.get (), " SELECT %d" , opt_.db_ )));
319+ auto reply = redis::ReplyPtr (
320+ reinterpret_cast <redisReply*>(
321+ redisCommand (connection.get (), " SELECT %d" , opt_.db_ )));
317322 CheckStatus (" select db error" , connection, reply);
318323 }
319324
0 commit comments