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 { ...@@ -106,10 +106,9 @@ public class FlinkAppUtil {
*/ */
private static void sendHook(int taskId, String jobId, int reTryCount) { private static void sendHook(int taskId, String jobId, int reTryCount) {
String dinkyAddr = SystemConfiguration.getInstances().getDinkyAddr().getValue(); String dinkyAddr = SystemConfiguration.getInstances().getDinkyAddr().getValue();
String url = StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId);
try { try {
String url = String resultStr = HttpUtil.get(url, 5000);
StrFormatter.format("{}/api/jobInstance/hookJobDone?taskId={}&jobId={}", dinkyAddr, taskId, jobId);
String resultStr = HttpUtil.get(url);
// TODO 这里应该使用Result实体类,但是Result.class不在comm里,迁移改动太大,暂时不搞 // TODO 这里应该使用Result实体类,但是Result.class不在comm里,迁移改动太大,暂时不搞
String code = JsonUtils.parseObject(resultStr).get("code").toString(); String code = JsonUtils.parseObject(resultStr).get("code").toString();
if (!"0".equals(code)) { if (!"0".equals(code)) {
...@@ -117,8 +116,13 @@ public class FlinkAppUtil { ...@@ -117,8 +116,13 @@ public class FlinkAppUtil {
StrFormatter.format("Send Hook Job Done result failed,url:{},err:{} ", url, resultStr)); StrFormatter.format("Send Hook Job Done result failed,url:{},err:{} ", url, resultStr));
} }
} catch (Exception e) { } catch (Exception e) {
if (reTryCount < 30) { if (reTryCount < 10) {
log.error("send hook failed,retry later taskId:{},jobId:{},{}", taskId, jobId, e.getMessage()); log.error(
"send hook failed,retry later,url:{}, taskId:{},jobId:{},{}",
url,
taskId,
jobId,
e.getMessage());
try { try {
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException ex) { } 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