Http Ballerina:在启动入站响应之前触发空闲超时
我正在一个芭蕾舞项目中执行任务预约,该项目每10分钟运行一次。它可以正常工作大约一个小时,但当执行时间达到2小时时,它会给我一个错误。以下是错误日志Http Ballerina:在启动入站响应之前触发空闲超时,http,ballerina,Http,Ballerina,我正在一个芭蕾舞项目中执行任务预约,该项目每10分钟运行一次。它可以正常工作大约一个小时,但当执行时间达到2小时时,它会给我一个错误。以下是错误日志 2018-10-04 12:00:00,002 INFO - Scanning the Github repository 2018-10-04 12:01:00,008 ERROR - Idle timeout triggered before initiating inbound response : {message:"Idle timeou
2018-10-04 12:00:00,002 INFO - Scanning the Github repository
2018-10-04 12:01:00,008 ERROR - Idle timeout triggered before initiating inbound response : {message:"Idle timeout triggered before initiating inbound response", cause:null, statusCode:0}
从错误日志来看,空闲时间似乎是1分钟
2018-10-04 12:00:00,002 INFO - Scanning the Github repository
2018-10-04 12:01:00,008 ERROR - Idle timeout triggered before initiating inbound response : {message:"Idle timeout triggered before initiating inbound response", cause:null, statusCode:0}
这是程序代码
public function main(string... args) {
log:printInfo("------ Scheduling Appointments --------------");
(function() returns error?) onTriggerFunction = gitHubTaskExecute;
(function(error)) onErrorFunction = gitGubTaskError;
gitGubTask = new task:Appointment(onTriggerFunction,
onErrorFunction,
"0 30 1 * * ?");
gitGubTask.schedule();
}
}
@Description { value:"Execute the Github repository scanning task"}
function gitHubTaskExecute() returns (error?) {
log:printInfo("Scanning the Github repository : " + repository);
executedTaskCount = executedTaskCount + 1;
if (executedTaskCount == 100) {
log:printInfo("Stopping Appointment#1 cleanup task since it
has run 100 times");
gitGubTask.cancel();
}
return cleanup();
}
@Description { value:"Execute the task cleanup"}
function cleanup() returns (error?) {
//Call function here
return ();
}
知道是什么触发了这个错误吗?我想执行一项每天都要执行的任务 请注意,当连接空闲超过指定时间段时,将触发IdleTimeout。然后服务器/客户机将使用适当的响应关闭连接。如果要禁用它,可以将其设置为
=0
示例客户端终结点:
endpoint http:Client clientEndpoint {
url: "http://localhost:9090",
timeoutMillis: 300000
};
http客户端和服务器端点中有一个名为timeoutInMillis
的配置。如果需要,可以增加该值