Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
You should increase timeout for requesting piwik api. Default timeout for drupal_http_request is 30. This is too small for our heavy website.
function piwik_stats_api_request($piwik_url, $token_auth, $method, $site_id, $period = 'year', $date = 'now', $format = 'xml') {
// Send off the API request.
return drupal_http_request(
url($piwik_url,
array(
'query' => array(
'module' => 'API',
'method' => $method,
'idSite' => $site_id,
'period' => $period,
'date' => $date,
'format' => $format,
'token_auth' => $token_auth,
'expanded' => TRUE,
),
)
),array('timeout' => 240 )
);
}
I have search a while till i found this ;- )
Comment | File | Size | Author |
---|---|---|---|
#1 | http_request_timeout-1694518-1.patch | 1.59 KB | patrickd |
Comments
Comment #1
patrickd CreditAttribution: patrickd commentedAdded a new advanced setting "Piwik API request timeout" to control this.
tested and committed to 7.x-1.x
thanks! :)
Comment #2
patrickd CreditAttribution: patrickd commented(default value is 30 secs)
Comment #4
patrickd CreditAttribution: patrickd commented