wpsc_update_timeout_terminate

Located in: updating-functions.php

Functions that call this hook: check_timeout()
Arguments Accepted: None
Version Introduced: 3.8

Description: This hook is called if the max execution time is about to run out and the page will need to be refreshed. It is used within the upgrade script when the data base is very first upgraded from 3.7 to 3.8.

Code in context:
[php firstline=”40″ highlight=”47″]
public function check_timeout() {
$safety = 2; // refresh page within 2 seconds of PHP max execution time limit
$wiggle_room = $this->timeout – $safety;

$terminate = time() – $this->script_start >= $wiggle_room;

if ( $terminate ) {
do_action( ‘wpsc_update_timeout_terminate’ );
$location = remove_query_arg( array( ‘start_over’, ‘eta’, ‘current_percent’ ) );
$location = add_query_arg( ‘run_updates’, 1, $location );
$location = apply_filters( ‘wpsc_update_terminate_location’, $location );
?>
<script type="text/javascript">
location.href = "<?php echo $location; ?>"
</script>
<?php
exit;
}
}
[/php]