0

i am calling an ajax function every second to make an online class link live, if the class link is finished i need to display the last class until the current time matches with the scheduled class time which needs to be enabled live. so i called ajax function using set interval method, and it works fine but i am getting an error like 504 Gateway time out error and the whole site is not working. so can any one give me good suggestion please ?

Below is my ajax code

$(function() {
  setInterval(updateLstream, 1000);
});
updateLstream();

function updateLstream() {
  $.ajax({
    type: 'POST',
    async: true,
    url: "../users/zbbtns_live.php",
    data: {
      cid: ""
    },
    success: function(data) {
      if (data.status == 1) {
        $(".setMainLiveBtn").html(data.Hdata);
      } else {
        //alert("No Live Streams");
        console.log("ss");
      }
    }
  });
}

0 Answers0