In my installation (as in most installations), PHP has a 30 second default. This meant that the "Update database" failed, but unfortunately too, the "Waiting..." message continues to be displayed giving the user the impression that they need to continue waiting! Fortunately I was able to find out the cause of the problem and create a hack to get round it; others may not be technically skilled enough to do this.
The following hack worked for me, and I think it would be a reasonable method to ensure other people don't get this problem.
In "ip2cc.inc" replace:
function _ip2cc_batch_insert() {
$file = drupal_get_path('module', 'ip2cc') .'/ip-to-country.csv';
with:
function _ip2cc_batch_insert() {
// Hack to try and ensure timeout is not reached
set_time_limit ( 300 );
$file = drupal_get_path('module', 'ip2cc') .'/ip-to-country.csv';
Strictly speaking I suppose the existing value of timeout should be queried and only a larger value set, i.e.
$big_time_limit = 300;
if (get_time_limit() < $big_time_limit) {
set_time_limit( $big_time_limit );
}
Of course it would be nice if an error message were issued if/when timeout occurred.
Comments
Comment #1
mrfelton commentedFixed in CVS. Thanks.