fix(1.5.0-beta1): 优化snailJobHttpExecutor逻辑

This commit is contained in:
opensnail 2025-04-21 22:03:28 +08:00
parent 607c3dc607
commit e75c56c248
4 changed files with 3 additions and 8 deletions

View File

@ -129,7 +129,7 @@ public abstract class AbstractHttpExecutor {
// 检查响应体是否包含指定的状态码字段
Map<String, Object> objectObjectMap = JsonUtil.parseHashMap(body);
if (!objectObjectMap.containsKey(field)) {
SnailJobLog.LOCAL.error("the responseType is jsonbut there is no status code field" + field);
SnailJobLog.LOCAL.error("the responseType is jsonbut there is no status code field{}", field);
return ExecuteResult.failure("the responseType is jsonbut there is no status code field" + field);
}
// 检查响应体中状态码是否与指定的状态码是否一致

View File

@ -23,12 +23,7 @@ public class SnailJobHttpExecutor extends AbstractHttpExecutor {
httpParams.setWfContext(jobArgs.getWfContext());
}
httpParams.setMethod(httpParams.getMethod().toUpperCase());
Map<String, String> hashMap = new HashMap<>(3);
hashMap.put(SystemConstants.SNAIL_JOB_CLIENT_GROUP, snailJobProperties.getGroup());
hashMap.put(SystemConstants.SNAIL_JOB_CLIENT_GROUP_TOKEN, snailJobProperties.getToken());
hashMap.put(SystemConstants.SNAIL_JOB_CLIENT_NAMESPACE, snailJobProperties.getNamespace());
Map<String, String> headers = (Objects.isNull(httpParams.getHeaders()) || httpParams.getHeaders().isEmpty()) ? new HashMap<>() : httpParams.getHeaders();
headers.putAll(hashMap);
httpParams.setHeaders(headers);
return process(httpParams);
}

View File

@ -41,7 +41,7 @@ public class JobLogServiceImpl implements JobLogService {
String sid = queryVO.getSid();
LogPageQueryDO pageQueryDO = new LogPageQueryDO();
pageQueryDO.setPage(1);
pageQueryDO.setSize(queryVO.getSize());
pageQueryDO.setSize(50);
pageQueryDO.setTaskBatchId(queryVO.getTaskBatchId());
pageQueryDO.setTaskId(queryVO.getTaskId());
pageQueryDO.setStartRealTime(queryVO.getStartRealTime());

View File

@ -100,7 +100,7 @@ public class RetryTaskServiceImpl implements RetryTaskService {
String sid = queryVO.getSid();
RetryTaskLogMessageQueryDO pageQueryDO = new RetryTaskLogMessageQueryDO();
pageQueryDO.setPage(1);
pageQueryDO.setSize(queryVO.getSize());
pageQueryDO.setSize(50);
pageQueryDO.setRetryTaskId(queryVO.getRetryTaskId());
pageQueryDO.setStartRealTime(queryVO.getStartRealTime());
pageQueryDO.setSearchCount(true);