feat(sj_1.1.0-beta3): 检验java不支持其他语言的执行器

This commit is contained in:
opensnail 2024-07-11 00:03:57 +08:00
parent a745a2d527
commit 689e7b2819
2 changed files with 7 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import com.aizuda.snailjob.client.job.core.log.JobLogMeta;
import com.aizuda.snailjob.client.model.StopJobDTO;
import com.aizuda.snailjob.client.model.request.DispatchJobRequest;
import com.aizuda.snailjob.common.core.context.SpringContext;
import com.aizuda.snailjob.common.core.enums.ExecutorTypeEnum;
import com.aizuda.snailjob.common.core.enums.JobTaskTypeEnum;
import com.aizuda.snailjob.common.core.model.JobArgsHolder;
import com.aizuda.snailjob.common.core.model.JobContext;
@ -59,6 +60,11 @@ public class JobEndPoint {
dispatchJob.getRetryCount());
}
if (ExecutorTypeEnum.JAVA.getType() != dispatchJob.getExecutorType()) {
SnailJobLog.REMOTE.error("不支持非Java类型的执行器. executorType:[{}]", dispatchJob.getExecutorType());
return new Result<>("不支持非Java类型的执行器", Boolean.FALSE);
}
JobExecutorInfo jobExecutorInfo = JobExecutorInfoCache.get(jobContext.getExecutorInfo());
if (Objects.isNull(jobExecutorInfo)) {
SnailJobLog.REMOTE.error("执行器配置有误. executorInfo:[{}]", dispatchJob.getExecutorInfo());

View File

@ -88,8 +88,7 @@ public class RequestHandlerActor extends AbstractActor {
String token = headers.get(HeadersEnum.TOKEN.getKey());
if (StrUtil.isBlank(token) || !CacheToken.get(groupName, namespace).equals(token)) {
SnailJobLog.LOCAL.error("Token authentication failed. [{}]", token);
return JsonUtil.toJsonString(new Result<>(0, "Token authentication failed"));
throw new SnailJobServerException("Token authentication failed. [{}]", token);
}
// 注册版本