feat(sj_1.1.0-beta3): 检验java不支持其他语言的执行器
This commit is contained in:
parent
a745a2d527
commit
689e7b2819
@ -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.StopJobDTO;
|
||||||
import com.aizuda.snailjob.client.model.request.DispatchJobRequest;
|
import com.aizuda.snailjob.client.model.request.DispatchJobRequest;
|
||||||
import com.aizuda.snailjob.common.core.context.SpringContext;
|
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.enums.JobTaskTypeEnum;
|
||||||
import com.aizuda.snailjob.common.core.model.JobArgsHolder;
|
import com.aizuda.snailjob.common.core.model.JobArgsHolder;
|
||||||
import com.aizuda.snailjob.common.core.model.JobContext;
|
import com.aizuda.snailjob.common.core.model.JobContext;
|
||||||
@ -59,6 +60,11 @@ public class JobEndPoint {
|
|||||||
dispatchJob.getRetryCount());
|
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());
|
JobExecutorInfo jobExecutorInfo = JobExecutorInfoCache.get(jobContext.getExecutorInfo());
|
||||||
if (Objects.isNull(jobExecutorInfo)) {
|
if (Objects.isNull(jobExecutorInfo)) {
|
||||||
SnailJobLog.REMOTE.error("执行器配置有误. executorInfo:[{}]", dispatchJob.getExecutorInfo());
|
SnailJobLog.REMOTE.error("执行器配置有误. executorInfo:[{}]", dispatchJob.getExecutorInfo());
|
||||||
|
@ -88,8 +88,7 @@ public class RequestHandlerActor extends AbstractActor {
|
|||||||
String token = headers.get(HeadersEnum.TOKEN.getKey());
|
String token = headers.get(HeadersEnum.TOKEN.getKey());
|
||||||
|
|
||||||
if (StrUtil.isBlank(token) || !CacheToken.get(groupName, namespace).equals(token)) {
|
if (StrUtil.isBlank(token) || !CacheToken.get(groupName, namespace).equals(token)) {
|
||||||
SnailJobLog.LOCAL.error("Token authentication failed. [{}]", token);
|
throw new SnailJobServerException("Token authentication failed. [{}]", token);
|
||||||
return JsonUtil.toJsonString(new Result<>(0, "Token authentication failed"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册版本
|
// 注册版本
|
||||||
|
Loading…
Reference in New Issue
Block a user