Skip to content

Commit c99097a

Browse files
resolve 413 response status for update task.
1 parent 348516b commit c99097a

File tree

1 file changed

+8
-0
lines changed
  • streamis-jobmanager/streamis-jobmanager-server/src/main/java/com/webank/wedatasphere/streamis/jobmanager/restful/api

1 file changed

+8
-0
lines changed

streamis-jobmanager/streamis-jobmanager-server/src/main/java/com/webank/wedatasphere/streamis/jobmanager/restful/api/JobRestfulApi.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ public Message executeHistoryJob(HttpServletRequest req,
235235
private Message withStreamJob(HttpServletRequest req, String projectName,
236236
String jobName, String username,
237237
Function<StreamJob, Message> streamJobFunction) {
238+
if(StringUtils.isBlank(projectName)) {
239+
return Message.error("projectName cannot be empty!");
240+
} else if(StringUtils.isBlank(jobName)) {
241+
return Message.error("jobName cannot be empty!");
242+
}
238243
List<QueryJobListVo> streamJobs = streamJobService.getByProList(projectName, username, jobName, null, null).getList();
239244
if(CollectionUtils.isEmpty(streamJobs)) {
240245
return Message.error("Not exits Streamis job " + jobName);
@@ -259,6 +264,9 @@ public Message addTask(HttpServletRequest req,
259264
@RequestParam(value = "appUrl") String appUrl) {
260265
String username = SecurityFilter.getLoginUsername(req);
261266
LOG.info("User {} try to add a new task for Streamis job {} with appId: {}, appUrl: {}.", username, jobName, appId, appUrl);
267+
if(StringUtils.isBlank(appId)) {
268+
return Message.error("appId cannot be empty!");
269+
}
262270
return withStreamJob(req, projectName, jobName, username, streamJob -> {
263271
// 如果存在正在运行的,先将其停止掉
264272
StreamTask streamTask = streamTaskService.getLatestTaskByJobId(streamJob.getId());

0 commit comments

Comments
 (0)