RabbitMqPlugin.php 833 B

123456789101112131415161718192021222324
  1. <?php
  2. class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
  3. {
  4. public function dispatchLoopShutdown()
  5. {
  6. if (Application_Model_RabbitMq::$doPush) {
  7. $md = array('schedule' => Application_Model_Schedule::getSchedule());
  8. Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
  9. if (!isset($_SERVER['AIRTIME_SRV'])) {
  10. Application_Model_RabbitMq::SendMessageToShowRecorder("update_recorder_schedule");
  11. }
  12. }
  13. if (memory_get_peak_usage() > 30*pow(2, 20)) {
  14. Logging::debug("Peak memory usage: "
  15. .(memory_get_peak_usage()/1000000)
  16. ." MB while accessing URI ".$_SERVER['REQUEST_URI']);
  17. Logging::debug("Should try to keep memory footprint under 25 MB");
  18. }
  19. }
  20. }