Skip to content

Commit 64e3e27

Browse files
authored
[Chore] Fix code scaning and cve (#18167)
1 parent 69b3536 commit 64e3e27

7 files changed

Lines changed: 26 additions & 14 deletions

File tree

‎dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/lifecycle/event/TaskFailoverLifecycleEvent.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public ILifecycleEventType getEventType() {
4040
return TaskLifecycleEventType.FAILOVER;
4141
}
4242

43+
@Override
4344
public String toString() {
4445
return "TaskFailoverLifecycleEvent{" +
4546
"task=" + taskExecution.getName() +

‎dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/lifecycle/event/WorkflowSucceedLifecycleEvent.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public ILifecycleEventType getEventType() {
4040
return WorkflowLifecycleEventType.SUCCEED;
4141
}
4242

43+
@Override
4344
public String toString() {
4445
return "WorkflowSucceedLifecycleEvent{" +
4546
"workflow=" + workflowExecution.getName() +

‎dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/workflow/listener/WorkflowSuccessLifecycleListener.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class WorkflowSuccessLifecycleListener implements IWorkflowLifecycleListe
5151
@Autowired
5252
private CommandDao commandDao;
5353

54+
@Override
5455
public void notifyWorkflowLifecycleEvent(final IWorkflowExecution workflowExecution,
5556
final AbstractWorkflowLifecycleLifecycleEvent lifecycleEvent) {
5657
final WorkflowInstance workflowInstance = workflowExecution.getWorkflowInstance();

‎dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/failover/FailoverCoordinator.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private void doWorkerFailover(final String workerAddress,
255255
log.info("Worker[{}] failover {} tasks finished, cost: {}/ms",
256256
workerAddress,
257257
needFailoverTasks.size(),
258-
failoverTimeCost.getTime());
258+
failoverTimeCost.getDuration());
259259
}
260260

261261
private List<ITaskExecution> getFailoverTaskForWorker(final String workerAddress,

‎dolphinscheduler-ui/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@antv/layout": "0.1.31",
1313
"@antv/x6": "^1.34.1",
1414
"@vueuse/core": "^9.2.0",
15-
"axios": "^0.27.2",
15+
"axios": "^1.15.0",
1616
"d3": "7.8.5",
1717
"date-fns": "^2.29.3",
1818
"date-fns-tz": "^1.3.7",

‎dolphinscheduler-ui/pnpm-lock.yaml‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dolphinscheduler-ui/src/service/service.ts‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'
18+
import axios, {
19+
AxiosRequestConfig,
20+
AxiosResponse,
21+
AxiosError,
22+
InternalAxiosRequestConfig
23+
} from 'axios'
1924
import { useUserStore } from '@/store/user/user'
2025
import { useUISettingStore } from '@/store/ui-setting/ui-setting'
2126
import qs from 'qs'
@@ -60,23 +65,27 @@ const baseRequestConfig: AxiosRequestConfig = {
6065

6166
const service = axios.create(baseRequestConfig)
6267

63-
const err = (err: AxiosError): Promise<AxiosError> => {
64-
if (err.response?.status === 401 || err.response?.status === 504) {
68+
const err = (error: unknown): Promise<never> => {
69+
const axiosError = error as AxiosError
70+
71+
if (
72+
axiosError.response?.status === 401 ||
73+
axiosError.response?.status === 504
74+
) {
6575
userStore.setSessionId('')
6676
userStore.setSecurityConfigType('')
6777
userStore.setUserInfo({})
6878
userStore.setBaseResDir('')
6979
router.push({ path: '/login' })
7080
}
7181

72-
return Promise.reject(err)
82+
return Promise.reject(error)
7383
}
7484

75-
service.interceptors.request.use((config: AxiosRequestConfig<any>) => {
76-
config.headers = config.headers || {}
77-
config.headers.sessionId = userStore.getSessionId
85+
service.interceptors.request.use((config: InternalAxiosRequestConfig) => {
86+
config.headers.set('sessionId', userStore.getSessionId)
7887
const language = cookies.get('language')
79-
if (language) config.headers.language = language
88+
if (language) config.headers.set('language', language)
8089

8190
return config
8291
}, err)

0 commit comments

Comments
 (0)