timeout

MS Captcha timeout duration in registration form in ASP.Net

老子叫甜甜 提交于 2019-12-10 21:11:35
问题 I am currently using MS Captcha in a registration form. It works perfectly if the form is submitted within a minute. But sometimes, after filling in the form the user then searches for documents to upload, and when they finally submit the form, they get server error as below: [NullReferenceException: Object reference not set to an instance of an object.] MSCaptcha.CaptchaControl.ValidateCaptcha(String userEntry) +438 On submit button click, I call the ValidateCaptcha as below: Captcha1

Limiting the timeout period for Selenium FindElement()

白昼怎懂夜的黑 提交于 2019-12-10 20:52:14
问题 How can I limit/reduce the timeout period for FindElement ? I am scraping a website. For a table which appears in thousands of pages, I can have either an element stating there is no information, or the table. I search for one of theses elements and when missing, I search for the other. The problem is that when one of them does not exist, it takes a long time until the FindElement times out. Can this period be shortened? Can the timeout period be defined per element? All I found about waits

JavaScript onKeyUp closures with timeout

痞子三分冷 提交于 2019-12-10 20:27:52
问题 Im trying to assign an onKeyUp event to all inputs within a form, using closures. the array fields contains all the names of the fields that require the event assigned to them. The array ajaxFields contains the names of the fields (from the array fields ) that requires ajax validation. function createEvents(fields,ajaxFields) { for(var x=0;x<fields.length;x++) { $('input[name='+fields[x]+']').keyup(function(field) { //assign an onKeyUp event return function() { //some code using variable

Implementing a timer in Android that's active all the time (even during screen timeout)

时光总嘲笑我的痴心妄想 提交于 2019-12-10 20:21:09
问题 I've implemented a Service in my android app that starts a timer (using the standard java.util.Timer and java.util.TimerTask mechanism) to do some processing in the background on a pre-defined interval. public class BackgroundProcessingService extends Service { private int interval; private Timer timer = new Timer(); public void onCreate() { super.onCreate(); startTimer(); } @Override public void onDestroy() { timer.cancel(); super.onDestroy(); } public int getInterval() { return interval; }

How to - Multiple Async tasks with timeout and cancellation

老子叫甜甜 提交于 2019-12-10 20:14:53
问题 I would like to fire several tasks while setting a timeout on them. The idea is to gather the results from the tasks that beat the clock, and cancel (or even just ignore) the other tasks. I tried using extension methods WithCancellation as explained here, however throwing an exception caused WhenAll to return and supply no results. Here's what I tried, but I'm opened to other directions as well (note however that I need to use await rather than Task.Run since I need the httpContext in the

Force timeout on a MysqlQuery from PHP

狂风中的少年 提交于 2019-12-10 19:50:05
问题 Is there a way to force Mysql from PHP to kill a query if it didn't return within a certain time frame? I sometimes see expensive queries running for hours (obviously by this time HTTP connection timed out or the user has left). Once enough such queries accumulate it starts to affect the overall performance badly. 回答1: Long running queries are a sign of poor design. It is best to inspect the queries in question and how they could be optimised. This would be just ignoring the problem. If still

How to debug a Heroku request timeout error

扶醉桌前 提交于 2019-12-10 19:46:07
问题 How would I find out what is causing h12 timeout errors on heroku? It happens randomly on different pages/controllers. This is the error that I get from the logs Processing by UsersController#new as HTML 2013-08-15T13:08:54.718157+00:00 app[web.1]: Started GET "/signup" for 105.226.239.198 at 2013-08-15 13:08:54 +0000 2013-08-15T13:08:54.744390+00:00 app[web.1]: Rendered communal/_error_messages.html.erb (0.6ms) 2013-08-15T13:09:24.714225+00:00 heroku[router]: at=error code=H12 desc="Request

NodeJS + Mongoose timeout on connection

可紊 提交于 2019-12-10 19:15:10
问题 So I've read that mongoose driver for NodeJS caches queries until it connects to MongoDB (no timeouts). But when the db crashes it should be possible to send a message to the user. So let's look at this NodeJS code: Users.find({}, function(err, result) { // Do something with result and send response to the user }); This may be hanging at infintum. So one way to fix this problem is to do the following var timeout = setTimeout(function() { // whem we hit timeout, respond to the user with

Stored procedure time out - but fine when run from SSMS

一世执手 提交于 2019-12-10 19:07:50
问题 I have a stored procedure which is erroring with "Timeout expired". The code involved is ADO/VB6. The stored procedure itself is not a problem, you can run it in a query window and it takes less than a second. The code used to get the connection etc is also modularised and in use all over a huge application. It is only in this one place that the timeout occurs, on one particular database. The error will be reproducable every time for hunderds of attempts, whether running the VB6 code in debug

In node.js if no response is received from an http request, how do you know?

独自空忆成欢 提交于 2019-12-10 18:54:12
问题 OK so in the below example I request something from a server. If a response comes back I parse the JSON and add the data to my mongodb. However if NO response comes back, then no event fires evidently. How would I add a timeout to this so that if no response is received, then I can cancel the request without any errors being thrown, and call a function? (I'm going to make it call a function that emails me.) Thanks! var req = https.request(options, function(res) { res.on('data', function(d) {