CC-4985: Ensure files deleted via the UI are deleted from stor directory.
-temporary fix. We know rabbitmq received the message, but we don't know if media-monitor actually acted on it.
This commit is contained in:
parent
52475b3dbf
commit
00d577fd5b
|
@ -22,6 +22,11 @@ class Application_Model_RabbitMq
|
||||||
$CC_CONFIG["rabbitmq"]["user"],
|
$CC_CONFIG["rabbitmq"]["user"],
|
||||||
$CC_CONFIG["rabbitmq"]["password"],
|
$CC_CONFIG["rabbitmq"]["password"],
|
||||||
$CC_CONFIG["rabbitmq"]["vhost"]);
|
$CC_CONFIG["rabbitmq"]["vhost"]);
|
||||||
|
|
||||||
|
if (!isset($conn)) {
|
||||||
|
throw new Exception("Cannot connect to RabbitMQ server");
|
||||||
|
}
|
||||||
|
|
||||||
$channel = $conn->channel();
|
$channel = $conn->channel();
|
||||||
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false,
|
$channel->access_request($CC_CONFIG["rabbitmq"]["vhost"], false, false,
|
||||||
true, true);
|
true, true);
|
||||||
|
|
|
@ -368,7 +368,12 @@ SQL;
|
||||||
|
|
||||||
if (file_exists($filepath) && $type == "stor") {
|
if (file_exists($filepath) && $type == "stor") {
|
||||||
$data = array("filepath" => $filepath, "delete" => 1);
|
$data = array("filepath" => $filepath, "delete" => 1);
|
||||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
try {
|
||||||
|
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Logging::error($e->getMessage());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue