File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1717#include "php_redis.h"
1818#include "library.h"
1919#include <ext/standard/php_math.h>
20+ #include <ext/standard/php_rand.h>
2021
2122#define UNSERIALIZE_ONLY_VALUES 0
2223#define UNSERIALIZE_ALL 1
@@ -64,7 +65,7 @@ PHPAPI int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
6465 // Wait for a while before trying to reconnect
6566 if (redis_sock -> retry_interval ) {
6667 // Random factor to avoid having several (or many) concurrent connections trying to reconnect at the same time
67- long retry_interval = (count ? redis_sock -> retry_interval : (random ( ) % redis_sock -> retry_interval ));
68+ long retry_interval = (count ? redis_sock -> retry_interval : (php_rand ( TSRMLS_C ) % redis_sock -> retry_interval ));
6869 usleep (retry_interval );
6970 }
7071 redis_sock_connect (redis_sock TSRMLS_CC ); /* reconnect */
You can’t perform that action at this time.
0 commit comments