MT#55283 redis: print the command timeout in milliseconds

Ref #2211

redis_set_timeout() receives the timeout in microseconds (the
--redis-cmd-timeout value times 1000) and logged it unconverted, so
--redis-cmd-timeout=1000 was reported as:

  Setting timeout for Redis commands to 1000000 milliseconds

Log the value in milliseconds, as the message says. The value passed to
hiredis is unchanged.

No functional change. Seen in the log of every connection made with a
command timeout set; there is no test, as no test reads this line.

Change-Id: Ie4d81e4f8baab1969210a589c98245407b088561
(cherry picked from commit 1c447b509b)
mr26.2
Kevin Binetruy 1 month ago committed by Richard Fuchs
parent 921b944827
commit bd119d7565

@ -241,7 +241,7 @@ int redis_set_timeout(struct redis* r, int64_t timeout) {
tv_cmd = timeval_from_us(timeout);
if (redisSetTimeout(r->ctx, tv_cmd))
return -1;
ilog(LOG_INFO, "Setting timeout for Redis commands to %" PRId64 " milliseconds", timeout);
ilog(LOG_INFO, "Setting timeout for Redis commands to %" PRId64 " milliseconds", timeout / 1000);
return 0;
}

Loading…
Cancel
Save