我正在芭蕾舞项目中执行任务预约,该项目每 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 timeout triggered before initiating inbound response", cause:null, statusCode:0}
从错误日志看来空闲时间是1分钟。
这是程序代码。
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
的配置。如果需要,您可以增加该值。
关于http - 芭蕾舞 Actor : Idle timeout triggered before initiating inbound response,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52640934/