标签: timeout

php timeout - set_time_limit(0); - 不要工作

我的PHP文件有问题,执行时间超过30秒.

搜索之后,我set_time_limit(0);在代码开头添加了cbut,文件仍然500 error在30秒后超时.

log: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /xxx/xx/xxx.php

safe-mode : off
Run Code Online (Sandbox Code Playgroud)

php timeout execution

24
推荐指数
4
解决办法
11万
查看次数

HttpWebRequest超时处理

我有一个非常简单的问题.我正在使用HTTP POST将文件上传到服务器.问题是我需要专门处理连接超时并在发生超时后添加一些等待算法来重新启动服务器.

我的代码非常简单:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("SomeURI");
request.Method = "POST";
request.ContentType = "application/octet-stream";
request.KeepAlive = true;
request.Accept = "*/*";
request.Timeout = 300000;
request.AllowWriteStreamBuffering = false;

try
{
      using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
      {
            WebHeaderCollection headers = response.Headers;    
            using (Stream Answer = response.GetResponseStream())
            {
                // Handle.
            }
      }
}
catch (WebException e)
{
    if (Timeout_exception)
    {
       //Handle timeout exception
    }
}
Run Code Online (Sandbox Code Playgroud)

我省略了文件读取代码,因为它不是我们关注的问题.现在我需要确保一旦抛出WebException,我会过滤异常以查看它是否确实是超时异常.我想与异常消息进行比较但我不确定这是否是正确的方法,因为有问题的应用程序是商业应用程序,我担心消息在不同语言之间有所不同.我应该寻找什么信息.

有什么建议?

.net c# timeout exception httpwebrequest

24
推荐指数
1
解决办法
4万
查看次数

使用jQuery以特定时间间隔显示和隐藏div

我想以特定间隔(10秒)显示div并显示下一个div并继续并重复相同的操作.

**

序列 :

**在第10秒显示div1,隐藏其他div, 5秒
后间隔显示div 2并隐藏其他div,
5秒后间隔显示div 3并隐藏其他div,
并每10秒重复一次.


代码遵循:


<div id='div1' style="display:none;"> 
  <!-- content -->
</div>

<div id='div2' style="display:none;"> 
  <!-- content -->
</div>

<div id='div3' style="display:none;"> 
  <!-- content -->
</div>
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery timeout

23
推荐指数
4
解决办法
13万
查看次数

如何在Java servlet容器上指定Http Request超时参数

我想知道在哪里可以为到达我的servlet(或我所有的servlet)的所有请求配置请求超时?那是我认为的容器财产吗?另外,这对不同的浏览器有何影响?它们都符合容器规定的参数吗?或者请求超时时间甚至不是我可以控制的,每个浏览器自己决定这个?(为了清楚我不是在谈论会话超时)

java containers timeout servlets httprequest

23
推荐指数
2
解决办法
4万
查看次数

为什么ASP.NET MVC真的短暂超时?

我有一个MVC 2应用程序,其中超时设置为2880(我理解它的分钟,但即使它是几秒钟就有问题):

<authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
Run Code Online (Sandbox Code Playgroud)

现在这应该意味着48小时,或至少48分钟(如果值是秒).但用户只需几分钟的不活动即可退出...

这是为什么?任何帮助赞赏!

asp.net authentication timeout asp.net-mvc-2

23
推荐指数
1
解决办法
1万
查看次数

MSTest:如何增加测试时间

我有一个测试需要工作超过1分钟(VS2008,MSTest,从VisualStudio启动测试):

    const int TestTimeout = 1;

    [TestMethod]
    [Timeout(10*60*1000)] // 10 minutes
    public void Login_ExpirationFail_Test()
    {
        IAuthenticationParameters parameters = new AuthenticationParameters(...);
        LdapAuthentication auth1 = new LdapAuthentication();
        IAuthenticationLoginResult res = auth1.Login(parameters);

        Assert.IsNotNull(res);
        Assert.IsFalse(string.IsNullOrEmpty(res.SessionId));

        const int AdditionalMilisecodns = 400;
        System.Threading.Thread.Sleep((TestTimeout * 1000 + AdditionalMilisecodns) * 60);

        LdapAuthentication auth2 = new LdapAuthentication();
        auth2.CheckTicket(res.SessionId);
    }
Run Code Online (Sandbox Code Playgroud)

此测试在"运行"模式下完成,"测试'Login_ExpirationFail_Test'超出执行超时期限." 错误消息,在"调试" - 它工作正常.

我看到几个与从命令行启动测试相关的类似问题.

如何在"运行"模式下使我的测试可行?

谢谢.

tdd unit-testing mstest timeout .net-3.5

23
推荐指数
2
解决办法
1万
查看次数

iOS应用程序 - 为UIWebView加载设置超时

我有一个简单的iOS本机应用程序,可以加载单个UIWebView.如果应用程序没有完全在20秒内完成在webView中加载初始页面,我希望webView显示错误消息.

我在这里加载了我的webView viewDidLoad(简化):

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.example.com"] cachePolicy:NSURLCacheStorageAllowed timeoutInterval:20.0]];
Run Code Online (Sandbox Code Playgroud)

timeoutInterval代码在上述范围内实际上并没有"做"什么,因为苹果有它在操作系统中设置为不实际超时240秒.

我设置了自己的webView didFailLoadWithError操作,但如果用户有网络连接,则永远不会调用它.webView继续尝试使用我的networkActivityIndi​​cator旋转加载.

有没有办法为webView设置超时?

xcode timeout loading uiwebview ios5

23
推荐指数
2
解决办法
3万
查看次数

GitLab CI管道阶段超时

我正在使用自托管GitLab CI server(社区版v8.9.5)和gitlab-ci-multi-runner1.2.0来构建项目.我的一个管道阶段(测试)需要一段时间才能运行,我得到以下erm:

ERROR: Build failed: execution took longer than 3600 seconds
Run Code Online (Sandbox Code Playgroud)

我在哪里放置超时的覆盖?我可以将它应用于测试管道阶段吗?

timeout gitlab-ci

23
推荐指数
3
解决办法
1万
查看次数

Python,Popen和select - 等待进程终止或超时

我使用以下命令运行子进程:

  p = subprocess.Popen("subprocess", 
                       stdout=subprocess.PIPE, 
                       stderr=subprocess.PIPE, 
                       stdin=subprocess.PIPE)
Run Code Online (Sandbox Code Playgroud)

此子进程可以立即退出stderr上的错误,也可以继续运行.我想检测这些条件中的任何一个 - 后者等待几秒钟.

我试过这个:

  SECONDS_TO_WAIT = 10
  select.select([], 
                [p.stdout, p.stderr], 
                [p.stdout, p.stderr],
                SECONDS_TO_WAIT)
Run Code Online (Sandbox Code Playgroud)

但它只是返回:

  ([],[],[])
Run Code Online (Sandbox Code Playgroud)

无论哪种条件.我能做什么?

python select subprocess timeout popen

22
推荐指数
2
解决办法
4万
查看次数

当py.test静默挂起时该怎么办?

在使用py.test时,我有一些测试可以正常运行SQLite但在我切换到Postgresql时静默挂起.我该如何调试这样的东西?是否有"详细"模式我可以运行我的测试,或设置断点?更一般地说,当pytest无声地停止时,标准的攻击计划是什么?我已经尝试使用pytest-timeout,并使用$ py.test --timeout = 300运行测试,但测试仍然挂起,屏幕上没有任何活动

sqlite postgresql timeout hang pytest

22
推荐指数
4
解决办法
9425
查看次数