/**
* Gets the interval when the scheduled clean cache purge needs to run.
* If Minutes option is selected, then the interval will be set to minutes.
* If Hours / Days options are selected, then it will be set to 1 hour.
*
* @since 3.4.3
*
* @return int $interval Interval time in seconds.
*/
private function get_interval() {
$unit = $this->options->get( 'purge_cron_unit' );
$lifespan = $this->options->get( 'purge_cron_interval', 10 );
$interval = HOUR_IN_SECONDS;
if ( ! $unit || ! defined( $unit ) ) {
$unit = 'HOUR_IN_SECONDS';
}
if ( 'MINUTE_IN_SECONDS' === $unit ) {
$interval = $lifespan * MINUTE_IN_SECONDS;
}
return $lifespan * $interval ;
}