CC-5888: Handle file deletion if the file is stored in the cloud
This commit is contained in:
parent
aaee522ec6
commit
7ca6b91cdf
4 changed files with 17 additions and 17 deletions
|
@ -402,6 +402,8 @@ SQL;
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
$apiKey = $CC_CONFIG["apiKey"][0];
|
||||
|
||||
//If the file was successfully deleted from the cloud the analyzer
|
||||
//will make a request to the Media API to do the deletion cleanup.
|
||||
$callbackUrl = 'http://'.$_SERVER['HTTP_HOST'].'/rest/media/'.$file_id.'/delete-success';
|
||||
|
||||
Application_Model_RabbitMq::SendDeleteMessageToAnalyzer(
|
||||
|
|
|
@ -330,10 +330,12 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
$requestData = json_decode($this->getRequest()->getRawBody(), true);
|
||||
|
||||
$con = Propel::getConnection();
|
||||
$storedFile = new Application_Model_StoredFile(CcFilesQuery::create()->findPk($id), $con);
|
||||
|
||||
$storedFile->doFileDeletionCleanup($requestData["filesize"]);
|
||||
if ($requestData["import_status"] == 1) {
|
||||
$con = Propel::getConnection();
|
||||
$storedFile = new Application_Model_StoredFile(CcFilesQuery::create()->findPk($id), $con);
|
||||
|
||||
$storedFile->doFileDeletionCleanup($requestData["filesize"]);
|
||||
}
|
||||
}
|
||||
|
||||
private function getId()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue