@@ -33,7 +33,9 @@ discard block |
||
33 | 33 | $ms = microtime(); |
34 | 34 | do { |
35 | 35 | $this->curl->tick(); |
36 | - if ($this->concurrent >= $this->maxConcurrent) usleep(max(1, min(1000000, $this->usleep))); |
|
36 | + if ($this->concurrent >= $this->maxConcurrent) { |
|
37 | + usleep(max(1, min(1000000, $this->usleep))); |
|
38 | + } |
|
37 | 39 | } while ($this->concurrent >= $this->maxConcurrent); |
38 | 40 | return max(0, microtime() - $ms); |
39 | 41 | } |
@@ -70,7 +72,9 @@ discard block |
||
70 | 72 | $redis = isset($setup['etag']) ? $setup['etag'] : null; |
71 | 73 | if ($redis !== null && $params['callType'] == 'GET') { |
72 | 74 | $etag = $redis->get("guzzler:etags:$uri"); |
73 | - if ($etag != "") $setup['If-None-Match'] = $etag; |
|
75 | + if ($etag != "") { |
|
76 | + $setup['If-None-Match'] = $etag; |
|
77 | + } |
|
74 | 78 | } |
75 | 79 | unset($setup['etag']); |
76 | 80 | |
@@ -81,7 +85,9 @@ discard block |
||
81 | 85 | $guzzler->dec(); |
82 | 86 | $content = (string) $response->getBody(); |
83 | 87 | $this->lastHeaders = array_change_key_case($response->getHeaders()); |
84 | - if (isset($this->lastHeaders['etag']) && strlen($content) > 0 && $redis !== null) $redis->setex("guzzler:etags:" . $params['uri'], 604800, $this->lastHeaders['etag'][0]); |
|
88 | + if (isset($this->lastHeaders['etag']) && strlen($content) > 0 && $redis !== null) { |
|
89 | + $redis->setex("guzzler:etags:" . $params['uri'], 604800, $this->lastHeaders['etag'][0]); |
|
90 | + } |
|
85 | 91 | |
86 | 92 | $fulfilled($guzzler, $params, $content); |
87 | 93 | }, |