Unverified Commit b242eac4 authored by gaoyan's avatar gaoyan Committed by GitHub

[Optimization]Fix the issue that clusters are not automatically deleted in app mode (#3374)

parent be747e50
......@@ -106,10 +106,9 @@ public class FlinkAppUtil {
*/
private static void sendHook(int taskId, String jobId, int reTryCount) {
String dinkyAddr = SystemConfiguration.getInstances().getDinkyAddr().getValue();
String url = StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId);
try {
String url =
StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId);
String resultStr = HttpUtil.get(url);
String resultStr = HttpUtil.get(url, 5000);
// TODO 这里应该使用Result实体类,但是Result.class不在comm里,迁移改动太大,暂时不搞
String code = JsonUtils.parseObject(resultStr).get("code").toString();
if (!"0".equals(code)) {
......@@ -117,8 +116,13 @@ public class FlinkAppUtil {
StrFormatter.format("Send Hook Job Done result failed,url:{},err:{} ", url, resultStr));
}
} catch (Exception e) {
if (reTryCount < 30) {
log.error("send hook failed,retry later taskId:{},jobId:{},{}", taskId, jobId, e.getMessage());
if (reTryCount < 10) {
log.error(
"send hook failed,retry later,url:{}, taskId:{},jobId:{},{}",
url,
taskId,
jobId,
e.getMessage());
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment