Chrome timeout Ajax request after 120 seconds?

…衆ロ難τιáo~ 提交于 2019-12-04 04:19:48

问题


I am not sure if it is a bug or configuration error but I keep getting ajax requests "canceled" at exactly 120 seconds. No http response code given.

The server side is running on a LAMP stack and the php max_execution_time is set to 240 seconds using mod_php5

Oddly enough, if I request the same page without ajax, it won't timeout after 120 seconds.

Early tests shows that firefox does the same thing.

Can anyone help with this bug/annoyance?

Sample code

set_timeout_limit(o); 
sleep(1000);

回答1:


try to add timeout: xxx (in ms) to your AJAX call

example:

$.ajax({
  url: "test.html",
  timeout: 240000,
  context: document.body,
  success: function(){
    $(this).addClass("done");
  }
});



回答2:


I already had your problem!I use set_time_limit(0) but my script stop after 630 Seconds!i put long time on this problem and i figure out that server firewall kill my process!maybe your problem is this too!if you access to your server WHM go to Process manager and take a look at your process! ;)



来源:https://stackoverflow.com/questions/6578834/chrome-timeout-ajax-request-after-120-seconds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!