caishunfeng commented on code in PR #13194:
URL:
https://github.com/apache/dolphinscheduler/pull/13194#discussion_r1050541792
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java:
##########
@@ -319,4 +329,30 @@ public TaskInstance queryTaskInstanceById(User loginUser,
long projectCode, Long
}
return taskInstance;
}
+
+ @Override
+ public TaskInstanceRemoveCacheResponse removeTaskInstanceCache(User
loginUser, long projectCode,
+ Integer
taskInstanceId) {
+ Result result = new Result();
+
+ Project project = projectMapper.queryByCode(projectCode);
+ projectService.checkProjectAndAuthThrowException(loginUser, project,
INSTANCE_UPDATE);
+
+ TaskInstance taskInstance =
taskInstanceMapper.selectById(taskInstanceId);
+ if (taskInstance == null) {
+ logger.error("Task definition can not be found, projectCode:{},
taskInstanceId:{}.", projectCode,
+ taskInstanceId);
+ putMsg(result, Status.TASK_INSTANCE_NOT_FOUND);
+ return new TaskInstanceRemoveCacheResponse(result);
+ }
+ String tagCacheKey = taskInstance.getCacheKey();
+ Pair<Integer, String> taskIdAndCacheKey =
TaskCacheUtils.revertCacheKey(tagCacheKey);
+ String cacheKey = taskIdAndCacheKey.getRight();
+ if (!StringUtils.isEmpty(cacheKey)) {
Review Comment:
```suggestion
if (StringUtils.isNotEmpty(cacheKey)) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]