From 754c7bfc64d58574e336542ab16c22926d89b29e Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 14 Jan 2015 15:15:23 -0500 Subject: [PATCH] Removed code that was deleting the cloud_file database records in the case of station termination. The database will remain as is in case we have to restore the files. --- airtime_mvc/application/cloud_storage/Amazon_S3.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/cloud_storage/Amazon_S3.php b/airtime_mvc/application/cloud_storage/Amazon_S3.php index f679fad0b..de236faf5 100644 --- a/airtime_mvc/application/cloud_storage/Amazon_S3.php +++ b/airtime_mvc/application/cloud_storage/Amazon_S3.php @@ -60,19 +60,14 @@ class Amazon_S3 extends StorageBackend } } + // This should only be called for station termination. + // We are only deleting the file objects from Amazon S3. + // Records in the database will remain in case we have to restore the files. public function deleteAllCloudFileObjects() { $this->s3Client->deleteMatchingObjects( $bucket = $this->getBucket(), $prefix = Application_Model_Preference::GetStationName()); - // delete record of the cloud files from the database - $criteria = new Criteria(); - $criteria->clearSelectColumns(); - $criteria->addSelectColumn(CloudFilePeer::CC_FILE_ID); - $results = CloudFilePeer::doSelectStmt($criteria)->fetchAll(); - foreach ($results as $key => $value) { - CcFilesQuery::create()->findPk($value["cc_file_id"])->delete(); - } } }