Quellcode durchsuchen

HPCC-14405 Redis Plugin - cache all subscription connections

Fix build error on CLang

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman vor 9 Jahren
Ursprung
Commit
f1d6946e25
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      plugins/redis/redis.cpp

+ 2 - 2
plugins/redis/redis.cpp

@@ -308,7 +308,7 @@ void Connection::redisConnect()
         unsigned timeStillLeft = timeLeft();
         if (timeStillLeft == 0)
             rtlFail(0, "Redis Plugin: ERROR - function timed out internally.");
-        struct timeval to = { timeStillLeft/1000, (timeStillLeft%1000)*1000 };
+        struct timeval to = { (time_t) (timeStillLeft/1000), (suseconds_t) ((timeStillLeft%1000)*1000) };
         context = ::redisConnectWithTimeout(ip.str(), port, to);
     }
     assertConnection("connection");
@@ -354,7 +354,7 @@ void * Connection::redisCommand(const char * format, ...)
 }
 int Connection::setTimeout(unsigned _timeout)
 {
-    struct timeval to = { _timeout/1000, (_timeout%1000)*1000 };
+    struct timeval to = { (time_t) (_timeout/1000), (suseconds_t) ((_timeout%1000)*1000) };
     if (!context)
         return REDIS_ERR;
     return ::redisSetTimeout(context, to);//NOTE: ::redisSetTimeout sets the socket timeout and therefore 0 => forever