timeout

Why don't synchronous ajax calls in jquery support timeout?

别等时光非礼了梦想. 提交于 2019-12-19 03:40:32
问题 I was reading here that synchronous ajax calls in jquery don't time out. Is this a technical limitation, or just something the authors didn't feel like supporting? What actually happens under the table when an ajax call is synchronous? 回答1: The browser handles synchronous/asynchronous requests via the XMLHttpRequest API, but it does not have a built-in timeout feature. JQuery implements its own timeout in JavaScript on top of the browser XHR API. Since a synchronous call blocks all running

User Inactivity Logout PHP

那年仲夏 提交于 2019-12-19 02:49:21
问题 I want my users to be logged out automatically after X minutes of inactivity. I also want to have all sessions destroyed. How can this be done? How can I check for inactivity then perform a function to log them out??? 回答1: You could also do: $_SESSION['loginTime'] = time(); On every page, and when the user is trying to navigate and he has been inactive for an twenty minutes you can log him out like this: if($_SESSION['loginTime'] < time()+20*60){ logout(); } 回答2: I tired Michiels approach and

JSch session timeout limit

删除回忆录丶 提交于 2019-12-18 22:23:27
问题 I'm using JSch 0.1.50 to set up a connection to the remote server for my CI Jenkins plugin. Let's assume I'm trying to use here session.connect(60000); for the timeout 60 sec: Session session = null; try { JSch jsch = new JSch(); if (rsaIdentity != null && !rsaIdentity.equals("")) { jsch.addIdentity(rsaIdentity.trim()); } session = jsch.getSession(serverLogin, serverHost, Integer.parseInt(serverPort)); session.setPassword(getDescriptor().getOpenPassword(encryptedPasswordString)); session

Cloud Functions for Firebase onWrite timeout

狂风中的少年 提交于 2019-12-18 19:18:41
问题 I return transaction promise which should wait for transaction to finish before stopping the function. The transaction executes fine, but the promise seems to never resolve. I see in the Firebase console that this function always times out after 60s. const functions = require('firebase-functions'); const admin = require("firebase-admin"); const db = admin.database(); export let countFollowers = functions.database.ref('followers/{followee}/{follower}').onWrite(event => { const followee = event

Preventing a 504 Gateway Timeout with huge PHP script

守給你的承諾、 提交于 2019-12-18 17:35:11
问题 I'm currently running an Apache server (2.2) on my local machine (Windows) which I'm using to run some PHP scripts to take care of some tedious work. One of the scripts involves a ton of moving, resizing, and download / uploading files to another server. I would very much like the script to run constantly so that I don't have to baby the script by starting it up again every time it times out. set_time_limit(0); ignore_user_abort(1); Both are set in my script, but after about 30mins to an hour

Using an AngularJS timeout

人盡茶涼 提交于 2019-12-18 17:14:11
问题 I'm new to AngularJS. I'm currently looking at the $timeout service. I understand that it's like a wrapper for the setTimeout function. The documentation says that it provides exception handling. In addition, the documentation says I can cancel and flush a timeout. Can someone please explain to me when an exception would happen with a timeout? I also don't understand why I need to flush a timeout. I would love an explanation or maybe a jsfiddle. For the life of me, I can't figure out why or

Auth timeout problems with CakePHP

泪湿孤枕 提交于 2019-12-18 17:09:12
问题 This is really bugging me. Has been for years. No matter what I do with core.php or php.ini, my logins timeout after about an hour - usually. Some deployments of identical code and configuration timeout after a respectable amount of time. This is what I have at the moment on one site - timed out after about an hour: session.gc_divisor 1000 session.gc_maxlifetime 86400 session.gc_probability 1 Configure::write('Session.timeout', '28800'); Configure::write('Session.checkAgent', false);

Timeout a task with Java's SwingWorker

荒凉一梦 提交于 2019-12-18 16:51:19
问题 I am trying to implement a SwingWorker class within my application. Is there a way to set a length of time that after which, the SwingWorker "times out"? I was thinking that maybe throwing an OutOfTime exception that I can catch and then deal with. I'm just not sure how to implement it. Thanks for all your help! 回答1: Why not embed your task within a Runnable, drop it into a new single-threaded ExecutorService and then perform a get() on the resulting Future with an appropriate timeout. That

Is it possible to get pasted text without using the setTimeout() function?

ぐ巨炮叔叔 提交于 2019-12-18 16:46:34
问题 I found out that when pasting text (i.e. Hello ) by using the mouse, the following function will throw an empty popup: $('input:text').onpaste = function() { alert($('input:text').val()); }); The thing is, when the onpaste event is being fired, the text is not yet actually pasted to the input field (at least that's my guess). So changing the function to: $('input:text').onpaste = function() { setTimeout(function() { alert($('input:text').val() }, 100); } gives a correct result by showing a

Is it possible to get pasted text without using the setTimeout() function?

烂漫一生 提交于 2019-12-18 16:46:09
问题 I found out that when pasting text (i.e. Hello ) by using the mouse, the following function will throw an empty popup: $('input:text').onpaste = function() { alert($('input:text').val()); }); The thing is, when the onpaste event is being fired, the text is not yet actually pasted to the input field (at least that's my guess). So changing the function to: $('input:text').onpaste = function() { setTimeout(function() { alert($('input:text').val() }, 100); } gives a correct result by showing a