Exemplo n.º 1
0
 /**
  * This test imports all crash report files from the given directory
  * and checks how many files have been imported.
  */
 public function testImportFiles()
 {
     $batchImporter = new BatchImporter();
     $dirName = Yii::app()->getBasePath() . "/testData/import";
     // Import crash report files found in the directory
     $importedCrashReportCount = 0;
     $importedDebugInfoCount = 0;
     $ret = $batchImporter->importFiles($dirName, $importedCrashReportCount, $importedDebugInfoCount);
     $this->assertTrue($ret);
     // Ensure 1 crash report imported
     $this->assertTrue($importedCrashReportCount == 1);
     // Ensure 1 debug info file imported
     $this->assertTrue($importedDebugInfoCount == 1);
 }
Exemplo n.º 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;
 }