Traceback (most recent call last):<br>
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main<br>
status = self.run(options, args)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run<br>
wb.build(autobuilding=True)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build<br>
self.requirement_set.prepare_files(self.finder)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))<br>
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 821, in unpack_url
hashes=hashes<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 659, in unpack_http_url
hashes)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)<br>
File "/usr/local/lib/python2.7/dist-packages/pip/utils/hashes.py", line 46, in …Run Code Online (Sandbox Code Playgroud) 我在我的Java程序中使用jedis。它的版本是2.9.0。
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
<type>jar</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)
为了避免花费太多时间通过命令查询结果keys(*),我将键存储在一个集合中,当需要所有键时,使用以下命令从集合中查询它们:
public Set<String> getKeysFromDailySet(String day) {
Jedis jedis = jedisPool.getResource();
Set<String> keys = new HashSet<>();
try {
keys = jedis.smembers(day);
jedis.close();
} catch (Exception e) {
logger.error("fail get keys from daily set {}", day);
}
return keys;
}
Run Code Online (Sandbox Code Playgroud)
集合中有大约800 万个键,它会抛出以下超时异常:
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:202) ~[scoring-20180118.jar:na]
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40) ~[scoring-20180118.jar:na]
at redis.clients.jedis.Protocol.process(Protocol.java:151) ~[scoring-20180118.jar:na]
at redis.clients.jedis.Protocol.read(Protocol.java:215) ~[scoring-20180118.jar:na]
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340) ~[scoring-20180118.jar:na]
at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239) ~[scoring-20180118.jar:na]
at redis.clients.jedis.BinaryJedis.select(BinaryJedis.java:523) …Run Code Online (Sandbox Code Playgroud) 我有这段代码,我想知道是否有任何方法可以添加超时延迟:
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'})
WD = urlopen(req).read()
Run Code Online (Sandbox Code Playgroud) 我的一位网站客户在下订单时遇到了问题。当我检查错误日志时,我可以看到以下内容:
[warn] mod_fcgid: read data timeout in 45 seconds, referer: https://myDomain/cart
[error] Premature end of script headers: index.php, referer: https://myDomain/cart
Run Code Online (Sandbox Code Playgroud)
这个错误是什么意思?我应该怎么做才能消除这个错误?Plesk 控制面板中是否有任何设置需要更改?如果我将“Php设置”中的“max_execution_time”更改为3600可以解决吗?
我使用的是 Plesk 12.0.18、CentOS 5.11
我制作的这段代码。
public long detecFace(int threshold, int dir, JLabel... lbl) throws InterruptedException {
long timeStart = Calendar.getInstance().getTimeInMillis();
BufferedImage[] finalImg = new BufferedImage[10];
BufferedImage[] edgeImage = new BufferedImage[10];
long t = System.currentTimeMillis();
long end = t-300000;
while (t < end){
for (int i = 0; i < 5; i++) {
ip.setFileImage(df.getFile()[i]);
ip.procesImage(threshold, dir);
edgeImage[i] = ip.getEdgeImage();
//ImageDrawer.drawOriginalImage(edgeImage[i]); //BENER HASIL YANG KELUAR
finalImg[i] = showSelectedFace(RHT(edgeImage[i]), ResearchData.getOriginalImage()[i]);
//ImageDrawer.drawOriginalImage(finalImg[i]); //SALAH HASIL YANG KELUAR
int count = 1;
int total = count + i;
System.out.println(total);
if …Run Code Online (Sandbox Code Playgroud) 我已经利用过
options {
timeout(time: 10, unit: 'MINUTES')
}
Run Code Online (Sandbox Code Playgroud)
但我希望能够对超时采取行动,例如 slackNotification 等
有什么办法可以实现这一点
我的问题是关于最近我一直摸不着头脑的事情——
在我的拦截器中,我有一些代码可以解析和处理某些错误,并将根据错误的状态代码等以某些方式执行操作(我没有包含此代码,因为它实际上对这个问题没有任何作用,但如果有人有充分的理由为什么我应该包括它,我绝对可以。
我试图弄清楚如何net :: ERR_TIMED_OUT在拦截器中处理(使用谷歌浏览器/歌剧)。我已经追踪到一个点,我可以知道请求正在构建并正在“处理”,但在那之后,请求和响应都消失了。我最初的想法是,XMLHttpRequest某个地方出现了错误,并且它以某种方式被抑制,并且响应被丢弃。
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const intercepted = this.setHeaders(req);
return this.SetPendingRequests(next.handle(intercepted))
.pipe(catchError((err): Observable<HttpEvent<any>> => {
return this.ParseErrorResponse(err);
}));
}
Run Code Online (Sandbox Code Playgroud)
我也尝试过添加finalize(() => {})它,并且在每种情况下都工作得很好,除了这个,ERR_TIMED_OUT基本上似乎决定所有事情都必须停止。
我也尝试过直接连接XMLHttpRequest,而 Angular 对此并不太友好——因为我觉得问题的根源可能源于它本身。
所有 google/stackoverflow 搜索几乎都表明这是一个本地问题,但我觉得好像应该有某种方法在我的代码中处理它,所以如果用户在使用我的应用程序时遇到此错误,我会能够适当地处理这个问题。基本上,我只想要任何请求ERR_TIMED_OUT(奇怪的是,其他浏览器基本错误返回“未知错误”类型的错误 - 这是我发现的唯一奇怪的异常值,它只是停止了一切。我希望看到如果其他人遇到了这个问题/愿意帮助我找出它。
感谢对此事的任何帮助并提前致谢,
我有下面的代码来检查此错误,但我没有收到超时错误,它会进入其他条件
Response response = null;
try {
response = client.getResponse(URI.create(uri), headers, reuest);
} catch (Exception ex) {
if(ex instanceof SocketTimeoutException){
throw new ExternalClientException(Errors.TIMEOUT_ERROR);
} else {
throw new ExternalClientException(Errors.UNEXPECTED_ERROR);
}
}
Run Code Online (Sandbox Code Playgroud) 初始化串行后如何更改 Pyserial 中的超时?就像:
ser=serial.Serial("COM4", baudrate=19200,parity=serial.PARITY_NONE,stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS,timeout=0.5)
在那之后,我想改变超时。有什么例子吗?谢谢 BR
如果数据库在 3 秒后无法连接,我会尝试向客户端发回错误。我从猫鼬文档中发现了这些方法。
1)
mongoose.connect("mongodb://localhost/smslist?connectTimeoutMS=1000"
Run Code Online (Sandbox Code Playgroud)
2)设置此选项:
connectTimeoutMS: 1000
Run Code Online (Sandbox Code Playgroud)
我已经关闭了服务器以确保它不会响应,我预计客户端会在一秒后收到错误,但不幸的是这两个都不起作用,并且客户端仅在默认情况下 30 秒后收到错误据我所知,对于节点套接字。您知道我该如何解决这个问题吗?
timeout ×10
python ×3
java ×2
angular ×1
declarative ×1
feign ×1
http ×1
interceptor ×1
jedis ×1
jenkins ×1
loops ×1
mod-fcgid ×1
mongodb ×1
mongoose ×1
node.js ×1
plesk ×1
pyserial ×1
python-3.x ×1
redis ×1
spring ×1
tensorflow ×1
urllib ×1
while-loop ×1