Exemple #1
0
 public function testDeleteOldOperations()
 {
     // Create 10 operations
     $i = 0;
     for ($i = 0; $i < 10; $i++) {
         $op = new Operation();
         $op->status = Operation::STATUS_SUCCEEDED;
         $op->timestamp = time();
         $op->srcid = $i;
         $op->cmdid = '1234.' . $i;
         $op->optype = Operation::OPTYPE_IMPORTPDB;
         $op->operand1 = "C:\\Program Files\\Apache Software Foundations\\htdocs\\crashfix\\protected\\data\\debugInfo\\CrashRpt{$i}.pdb";
         $op->operand2 = "C:\\Program Files\\Apache Software Foundations\\htdocs\\crashfix\\protected\runtime\tmp1234{$i}.tmp";
         $this->assertTrue($op->save());
     }
     // Delete old operations
     Operation::deleteOldOperations(5);
     // Expect there are 5 ops now
     $count = Operation::model()->count();
     $this->assertTrue($count == 5);
 }
Exemple #2
0
 public function run($args)
 {
     Yii::log("Entering the method run", "info");
     if (0 != $this->checkDaemonStatus()) {
         return 1;
     }
     // Delete old operations
     Operation::deleteOldOperations();
     // Look for started debug info deletion operations,check their statuses
     // and finalize completed operations.
     $this->checkDebugInfoDeletionOperations();
     // Delete debug info files marked for deletion
     $this->deletePendingDebugInfoFiles();
     // Look for started debug info import operations, check their statuses
     // and finalize completed operations.
     $this->checkDebugInfoProcessingOperations();
     // Import new debug info files uploaded recently.
     $this->processNewDebugInfoFiles();
     // Look for started crash report processing operations, check their statuses
     // and finalize completed operations.
     $this->checkCrashReportProcessingOperations();
     // Process new crash report files uploaded recently.
     $this->processNewCrashReportFiles();
     // Send pending mail messages.
     MailQueue::sendMail();
     // Perform batch import of crash report files and PDB files
     $importDir = Yii::app()->getBasePath() . "/import";
     $batchImporter = new BatchImporter();
     $importedCrashReportCount = 0;
     $importedDebugInfoCount = 0;
     $batchImporter->importFiles($importDir, $importedCrashReportCount, $importedDebugInfoCount);
     // Delete old temp files
     $this->deleteOldTempFiles();
     // Success
     Yii::log("Leaving the method run", "info");
     return 0;
 }