Beispiel #1
0
 /**
  * Update server node status
  *
  * @action reportStatus
  * @param string $hostName
  * @return KalturaServerNode
  */
 function reportStatusAction($hostName, KalturaServerNode $serverNode = null)
 {
     $dbServerNode = ServerNodePeer::retrieveActiveServerNode($hostName, $this->getPartnerId());
     //Allow serverNodes auto registration without calling add
     if (!$dbServerNode) {
         if ($serverNode) {
             $dbServerNode = $this->addNewServerNode($serverNode);
         } else {
             throw new KalturaAPIException(KalturaErrors::SERVER_NODE_NOT_FOUND, $hostName);
         }
     }
     $dbServerNode->setHeartbeatTime(time());
     $dbServerNode->save();
     $serverNode = KalturaServerNode::getInstance($dbServerNode, $this->getResponseProfile());
     return $serverNode;
 }