___scheduleNext(); } /** * @since 3.8.12 */ private function ___scheduleNext() { // Get the set interval in seconds. $_oOption = AmazonAutoLinks_Option::getInstance(); $_iSize = ( integer ) $_oOption->get( array( 'cache', 'expired_cache_removal_interval', 'size' ), 7 ); $_iUnit = ( integer ) $_oOption->get( array( 'cache', 'expired_cache_removal_interval', 'unit' ), 86400 ); $_iInterval = $_iSize * $_iUnit; $_iTime = time() + $_iInterval; $this->scheduleSingleWPCronTask( $this->_sActionHookName, array(), $_iTime ); } /** * */ protected function _doAction() { // Expiry deletion $this->deleteExpiredTableItems(); // Table truncation $_oOption = AmazonAutoLinks_Option::getInstance(); // Keep the cache data base table size $this->truncateCacheTablesBySize( $_oOption->get( array( 'cache', 'table_size', 'products' ), '' ), $_oOption->get( array( 'cache', 'table_size', 'requests' ), '' ) ); $_oOption->update( array( 'cache', 'cache_removal_event_last_run_time' ), time() ); $this->___scheduleNext(); } }