Merge branch 'master' into develop
This commit is contained in:
commit
6eefd25e40
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import scala.Int;
|
||||
import tech.powerjob.common.enums.Protocol;
|
||||
import tech.powerjob.worker.PowerJobSpringWorker;
|
||||
import tech.powerjob.worker.common.PowerJobWorkerConfig;
|
||||
|
|
@ -19,11 +20,14 @@ public class PowerJobWorkerConfiguration {
|
|||
@Value("${powerjob.worker.server-address}")
|
||||
private String severAddress;
|
||||
|
||||
@Value("${powerjob.worker.port}")
|
||||
private int port;
|
||||
|
||||
@Bean
|
||||
public PowerJobSpringWorker initPowerJobWorker() {
|
||||
PowerJobWorkerConfig config = new PowerJobWorkerConfig();
|
||||
config.setAppName(appName);
|
||||
config.setPort(RandomUtil.randomInt(10000, 20000));
|
||||
config.setPort(port);
|
||||
config.setServerAddress(StrUtil.split(severAddress, ","));
|
||||
config.setProtocol(Protocol.HTTP);
|
||||
// 如果没有大型 Map/MapReduce 的需求,建议使用内存来加速计算
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<Property name="logDir" value="./logs" />
|
||||
|
||||
<springProperty scope="context" name="LOKI_URL" source="logging.loki.url" defaultValue=""/>
|
||||
<springProperty scope="context" name="appName" source="spring.application.name" defaultValue="admin"/>
|
||||
<springProperty scope="context" name="appName" source="spring.application.name" defaultValue="scheduled"/>
|
||||
<springProperty scope="context" name="profile" source="spring.profiles.active" defaultValue="dev"/>
|
||||
<define name="HOSTIP" class="com.nflg.wms.starter.definer.HostIpDefiner"/>
|
||||
|
||||
|
|
@ -84,6 +84,7 @@
|
|||
<logger name="tech.powerjob" level="INFO" additivity="false">
|
||||
<!-- <appender-ref ref="POWERJOB_WORKER_APPENDER" />-->
|
||||
<appender-ref ref="LOKI"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</logger>
|
||||
|
||||
<!-- 默认配置 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue