File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 17
17
#include "php_redis.h"
18
18
#include "library.h"
19
19
#include <ext/standard/php_math.h>
20
+ #include <ext/standard/php_rand.h>
20
21
21
22
#define UNSERIALIZE_ONLY_VALUES 0
22
23
#define UNSERIALIZE_ALL 1
@@ -64,7 +65,7 @@ PHPAPI int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
64
65
// Wait for a while before trying to reconnect
65
66
if (redis_sock -> retry_interval ) {
66
67
// 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 ));
68
69
usleep (retry_interval );
69
70
}
70
71
redis_sock_connect (redis_sock TSRMLS_CC ); /* reconnect */
You can’t perform that action at this time.
0 commit comments