timeout

Timeout on a Python function call inside timeit

被刻印的时光 ゝ 提交于 2019-12-24 10:46:30
问题 I have a function, let's call it my_function(*args, **kwargs) , that depending on the arguments passed to it takes anywhere from 30 seconds to many many hours (days). I have a list of different arguments and I want to know how long the functions will take given the arguments. I am still very new to using timeit , but I have learn enough to do this part; however, this wouldn't be the very efficient for my purposes. Any set of arguments that take longer than 4 hours to complete are consider

how to set mysql_ping timeout with MySQL++

假如想象 提交于 2019-12-24 10:36:35
问题 I want mysql_ping to timeout in matter of seconds. In the testcase below if a connection is established followed by "ifconfig eth0 down" the false side of conn.ping() is never reached. The thread/process enters what seems like an endless wait. I want to change this and make it timeout faster, preferably using MySQL++ options. Any idea which option that might be ? Maybe I also need to set how many times it will retry ? Reading up on the documentation for MySQL, it tells us mysql_ping will try

Timing out urllib2 urlopen operation in Python 2.4

假装没事ソ 提交于 2019-12-24 10:05:08
问题 I've just inherited some Python code and need to fix a bug as soon as possible. I have very little Python knowledge so please excuse my ignorance. I am using urllib2 to extract data from web pages. Despite using socket.setdefaulttimeout(30) I am still coming across URLs that hang seemingly indefinitely. I want to time out the extraction and have got this far after much searching the web: import socket socket.setdefaulttimeout(30) reqdata = urllib2.Request(urltocollect) def handler(reqdata): ?

iPhone Web service Request Timeout

元气小坏坏 提交于 2019-12-24 09:58:40
问题 I am having problems in my iphone application due to weak wifi signals. My application uses webservice to retireve data from our server but when Wifi signals are weak the response never comes back and user gets stuck on "Loading..." overlay screen. Finally the application crashes at the end. How can i handle this situation gracefully. Is there a way to set TimeOut for my webservice calls or something like this? Thanks, Asif. 回答1: try to use ASIHTTP lib http://allseeing-i.com/ASIHTTPRequest

set php session timeout by user

℡╲_俬逩灬. 提交于 2019-12-24 09:50:07
问题 It´s possible to set session timeout by user in php? Example: 2 users are registred in my site. I want that each user can set their own session timeout. 回答1: Yes, you can set a custom session timeout for each user. You can use the method as described in How do I expire a PHP session after 30 minutes? but store the absolute expiration time instead: // set expiration time $_SESSION['EXPIRES'] = time() + $customSessionLifetime; // validate session if (isset($_SESSION['EXPIRES']) && (time() < $

ASP.NET SessionState timeout

六眼飞鱼酱① 提交于 2019-12-24 09:26:29
问题 I use ASP.NET website on IIS7 where in web.config I have: <sessionState mode="InProc" timeout="20"></sessionState> But session doesn't keep 20 minutes, it works very strange, sometimes it expires in 1 minute or less, sometimes just redirect to other page. I need use mode="InProc". Who can help me, what is wrong and how to resolve this problem? Thanks! 回答1: If you have an application that is throwing unhandled exceptions, the application could recycle. Or, it could recycle because of memory

Apache 2.2 CGI perl timeouts, still times out even with periodic prints

随声附和 提交于 2019-12-24 09:14:52
问题 I have a cgi code that is being called by AJAX from clientside javascript. However, the result of the call is discarded by the client. On the backend this code occurs: $|=1; my $i = 0; while (<$fh_echo>) { #To prevent apache timing out the cgi script. print "." if $i % 100 == 0; #Do stuff $i++; } Despite the periodic print out, this still times out: [warn] [client 10.23.12.87] Timeout waiting for output from CGI script [error] [client 10.23.12.87] (70007)The timeout specified has expired: ap

spray, scala : change the timeout

强颜欢笑 提交于 2019-12-24 08:59:40
问题 I want to change the timeout in a spray application, but what is the simplest way to achieve this? I saw some examples on github but they are rather complicated. thanks. I tried this : class MyServiceActor extends Actor with MyService { sender ! SetRequestTimeout(scala.concurrent.duration.Duration(120,"second")) sender ! spray.io.ConnectionTimeouts.SetIdleTimeout(scala.concurrent.duration.Duration(120,"second")) // the HttpService trait defines only one abstract member, which // connects the

Pass timeout to Foundation 6 loading

橙三吉。 提交于 2019-12-24 08:58:25
问题 I'm using Angular2 and Foundation 6 for creating a webapp. I generate by myself scripts and styles from Foundation .scss files. Here is my index.html <html> <head> <title>MyApp</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <script src="scripts/foundation.min.js"></script> <link rel="stylesheet" href="styles/foundation.css"> </head> <body> <my-app