public function run($data, $id = null) {
		$this->hr();
		$this->out(__d('cake_settings_app', 'CakePHP Queue clearing cache task.'));
		$queueLength = $this->QueueInfo->getLengthQueue('ClearCache');
		if ($queueLength > 0) {
			$this->out(__d('cake_settings_app', 'Found clearing cache task in queue: %d. Skipped.', $queueLength));

			return true;
		}

		$cacheConfigs = Cache::configured();
		foreach ($cacheConfigs as $cacheConfigName) {
			Cache::clear(false, $cacheConfigName);
		}
		$this->QueuedTask->updateProgress($id, 1);

		return true;
	}
public function run($data, $id = null) {
		$this->hr();
		$this->out(__d('cake_settings_app', 'CakePHP Queue clearing cache task.'));
		$queueLength = $this->QueueInfo->getLengthQueue('ClearCache');
		if ($queueLength > 0) {
			$this->out(__d('cake_settings_app', 'Found clearing cache task in queue: %d. Skipped.', $queueLength));

			return true;
		}

		$cacheConfigs = Cache::configured();
		foreach ($cacheConfigs as $cacheConfigName) {
			Cache::clear(false, $cacheConfigName);
		}
		$this->QueuedTask->updateProgress($id, 1);

		return true;
	}
public function run ( $ data , $ id = null ) { $ this -> hr ( ) ; $ this -> out ( __d ( 'cake_settings_app' , 'CakePHP Queue clearing cache task.' ) ) ; $ queueLength = $ this -> QueueInfo -> getLengthQueue ( 'ClearCache' ) ; if ( $ queueLength > 0 ) { $ this -> out ( __d ( 'cake_settings_app' , 'Found clearing cache task in queue: %d. Skipped.' , $ queueLength ) ) ; return true ; } $ cacheConfigs = Cache :: configured ( ) ; foreach ( $ cacheConfigs as $ cacheConfigName ) { Cache :: clear ( false , $ cacheConfigName ) ; } $ this -> QueuedTask -> updateProgress ( $ id , 1 ) ; return true ; }
Main function.
Used for clear cache.

@param array $data The array passed to QueuedTask->createJob()
@param int $id The id of the QueuedTask
@triggers Model.afterUpdateTree $this->SubordinateDb
@return bool Success
@throws RuntimeException when seconds are 0;
Main function . Used for clear cache .