fix 修复 升级powerjob导致common-job插件异常
parent
1944cca859
commit
a902b8fcd9
|
|
@ -1,8 +1,8 @@
|
||||||
package org.dromara.common.job.config;
|
package org.dromara.common.job.config;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.job.config.properties.PowerJobProperties;
|
import org.dromara.common.job.config.properties.PowerJobProperties;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
|
@ -10,7 +10,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||||
import org.springframework.cloud.client.ServiceInstance;
|
import org.springframework.cloud.client.ServiceInstance;
|
||||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import tech.powerjob.common.utils.CommonUtils;
|
import tech.powerjob.common.utils.CommonUtils;
|
||||||
import tech.powerjob.common.utils.NetUtils;
|
import tech.powerjob.common.utils.NetUtils;
|
||||||
import tech.powerjob.worker.PowerJobSpringWorker;
|
import tech.powerjob.worker.PowerJobSpringWorker;
|
||||||
|
|
@ -20,16 +19,15 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动定时任务
|
* Autoconfiguration class for PowerJob-worker.
|
||||||
*
|
*
|
||||||
* @author yhan219
|
* @author songyinyin
|
||||||
* @since 2023/6/2
|
* @since 2020/7/26 16:37
|
||||||
*/
|
*/
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@ConditionalOnProperty(prefix = "powerjob.worker", name = "enabled", havingValue = "true")
|
|
||||||
@EnableConfigurationProperties(PowerJobProperties.class)
|
@EnableConfigurationProperties(PowerJobProperties.class)
|
||||||
@EnableScheduling
|
@ConditionalOnProperty(prefix = "powerjob.worker", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||||
public class PowerJobConfig {
|
public class PowerJobConfig{
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public PowerJobSpringWorker initPowerJob(PowerJobProperties properties, DiscoveryClient discoveryClient) {
|
public PowerJobSpringWorker initPowerJob(PowerJobProperties properties, DiscoveryClient discoveryClient) {
|
||||||
|
|
@ -87,7 +85,7 @@ public class PowerJobConfig {
|
||||||
* When enabledTestMode is set as true, PowerJob-worker no longer connects to PowerJob-server
|
* When enabledTestMode is set as true, PowerJob-worker no longer connects to PowerJob-server
|
||||||
* or validate appName.
|
* or validate appName.
|
||||||
*/
|
*/
|
||||||
config.setEnableTestMode(worker.isEnableTestMode());
|
config.setAllowLazyConnectServer(worker.isAllowLazyConnectServer());
|
||||||
/*
|
/*
|
||||||
* Max length of appended workflow context . Appended workflow context value that is longer than the value will be ignored.
|
* Max length of appended workflow context . Appended workflow context value that is longer than the value will be ignored.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,10 @@ public class PowerJobProperties {
|
||||||
*/
|
*/
|
||||||
private int maxResultLength = 8192;
|
private int maxResultLength = 8192;
|
||||||
/**
|
/**
|
||||||
* If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName.
|
* If allowLazyConnectServer is set as true, PowerJob worker allows launching without a direct connection to the server.
|
||||||
* Test mode is used for conditions that your have no powerjob-server in your develop env, so you can't start up the application
|
* allowLazyConnectServer is used for conditions that your have no powerjob-server in your develop env so you can't startup the application
|
||||||
*/
|
*/
|
||||||
private boolean enableTestMode = false;
|
private boolean allowLazyConnectServer = false;
|
||||||
/**
|
/**
|
||||||
* Max length of appended workflow context value length. Appended workflow context value that is longer than the value will be ignored.
|
* Max length of appended workflow context value length. Appended workflow context value that is longer than the value will be ignored.
|
||||||
* {@link WorkflowContext} max length for #appendedContextData
|
* {@link WorkflowContext} max length for #appendedContextData
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue