- } // end function GetLastJobStatus()
-
- public function GetLastErrorJobs( $delay = LAST_DAY )
- {
- $query = "";
-
- // Interval calculation
- $end_date = mktime();
- $start_date = $end_date - $delay;
-
- $start_date = date( "Y-m-d H:i:s", $start_date );
- $end_date = date( "Y-m-d H:i:s", $end_date );
-
- //echo "start date: $start_date <br />";
- //echo "end date: $end_date <br />";
-
- switch( $this->driver )
- {
- default:
- $query = 'SELECT COUNT(JobId) AS failed_jobs ';
- $query .= 'FROM Job ';
- $query .= "WHERE EndTime BETWEEN '$start_date' AND '$end_date' ";
- $query .= "AND JobStatus = 'f'";
- break;
- }
- $result = $this->db_link->query( $query );
-
- if (PEAR::isError( $result ) ) {
- die( "Unable to get last failed jobs status from catalog<br />query = $query <br />" . $result->getMessage() );
- }else {
- return $result->fetchRow( DB_FETCHMODE_ASSOC );
- } // end if else
- } // end function GetLastErrorJobs