<?php
	require_once( $GLOBALS["site_root"] . "/includes/tasks/GeneralTask.inc.php" );

	class ShuffleTask extends GeneralTask {

		public function __construct( $task_id , $task_processor ) {
			parent::__construct( $task_id , $task_processor );
		}

		public function processShuffleTask() {
			if ($this->task_processor->timeLeft()<3) return false;	// lejar az ido
			$query = sprintf( "update members set ordering=random()" );
			FNTH_db_free_result( FNTH_db_query( $query ) );
			return true;
		}
		
		public function processTask() {
			$success = $this->processShuffleTask();
			if ($success)
				$this->tm->closeTask();
			else
				$this->tm->releaseTask();
			return;
		}

	}



?>
