File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,9 @@ PHP_REDIS_API int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
187
187
}
188
188
// Wait for a while before trying to reconnect
189
189
if (redis_sock -> retry_interval ) {
190
- // Random factor to avoid having several (or many) concurrent
191
- // connections trying to reconnect at the same time
192
- long retry_interval = (count ? redis_sock -> retry_interval
193
- : (random () % redis_sock -> retry_interval ));
194
-
195
- usleep (retry_interval );
190
+ // Random factor to avoid having several (or many) concurrent connections trying to reconnect at the same time
191
+ long retry_interval = (count ? redis_sock -> retry_interval : (php_rand (TSRMLS_C ) % redis_sock -> retry_interval ));
192
+ usleep (retry_interval );
196
193
}
197
194
redis_sock_connect (redis_sock TSRMLS_CC ); /* reconnect */
198
195
if (redis_sock -> stream ) { /* check for EOF again. */
You can’t perform that action at this time.
0 commit comments