Skip to content

Commit

Permalink
resolve code review notice:
Browse files Browse the repository at this point in the history
* github-advanced-security CodeQL: Useless parameter
  • Loading branch information
Mighten committed Aug 18, 2024
1 parent e1cb208 commit 5ae3ba3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,14 @@ Watch createBatchWatcher(CountDownLatch countDownLatch,
/**
* Sets the status of a task.
*
* @param metadata {@link HasMetadata} object representing the Kubernetes resource metadata
* @param jobStatus The status of the job defined in {@link TaskConstants}.
* @param taskInstanceId A unique identifier to track the task instance.
* @param taskResponse the response of the task.
*/
default void setTaskStatus(HasMetadata metadata, int jobStatus, String taskInstanceId, TaskResponse taskResponse) {
default void setTaskStatus(int jobStatus, TaskResponse taskResponse) {
if (jobStatus == TaskConstants.EXIT_CODE_SUCCESS || jobStatus == TaskConstants.EXIT_CODE_FAILURE) {
if (jobStatus == TaskConstants.EXIT_CODE_SUCCESS) {
// log.info("[K8sYamlJobExecutor-{}] succeed in k8s", metadata.getMetadata().getName());
taskResponse.setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS);
} else {
// log.error("[K8sYamlJobExecutor-{}] fail in k8s", metadata.getMetadata().getName());
taskResponse.setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void eventReceived(Action action, Pod pod) {
if (jobStatus == TaskConstants.RUNNING_CODE) {
return;
}
setTaskStatus(hasMetadata, jobStatus, String.valueOf(taskInstanceId), taskResponse);
setTaskStatus(jobStatus, taskResponse);
countDownLatch.countDown();
}
} finally {
Expand Down

0 comments on commit 5ae3ba3

Please sign in to comment.