mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: mail send failed use WARN log level
This commit is contained in:
parent
5a50d933a8
commit
1868d9289f
@ -50,7 +50,7 @@ public class MailAlarmService implements Alarmable {
|
||||
|
||||
javaMailSender.send(sm);
|
||||
}catch (Exception e) {
|
||||
log.error("[MailAlarmService] send mail failed, reason is {}", e.getMessage());
|
||||
log.warn("[MailAlarmService] send mail failed, reason is {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ import com.github.kfcfans.powerjob.common.utils.NetUtils;
|
||||
import com.github.kfcfans.powerjob.server.akka.OhMyServer;
|
||||
import com.github.kfcfans.powerjob.server.persistence.core.model.AppInfoDO;
|
||||
import com.github.kfcfans.powerjob.server.persistence.core.repository.AppInfoRepository;
|
||||
import com.github.kfcfans.powerjob.server.persistence.core.repository.JobInfoRepository;
|
||||
import com.github.kfcfans.powerjob.server.service.ha.ServerSelectService;
|
||||
import com.github.kfcfans.powerjob.server.service.ha.WorkerManagerService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -35,8 +34,6 @@ public class ServerController {
|
||||
private ServerSelectService serverSelectService;
|
||||
@Resource
|
||||
private AppInfoRepository appInfoRepository;
|
||||
@Resource
|
||||
private JobInfoRepository jobInfoRepository;
|
||||
|
||||
@GetMapping("/assert")
|
||||
public ResultDTO<Long> assertAppName(String appName) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.github.kfcfans.powerjob.worker.autoconfigure;
|
||||
|
||||
import com.github.kfcfans.powerjob.common.utils.CommonUtils;
|
||||
import com.github.kfcfans.powerjob.common.utils.NetUtils;
|
||||
import com.github.kfcfans.powerjob.worker.OhMyWorker;
|
||||
import com.github.kfcfans.powerjob.worker.common.OhMyConfig;
|
||||
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition;
|
||||
@ -37,8 +38,14 @@ public class PowerJobAutoConfiguration {
|
||||
|
||||
// 1. 创建配置文件
|
||||
OhMyConfig config = new OhMyConfig();
|
||||
// 可以不显式设置,默认值 27777
|
||||
config.setPort(worker.getAkkaPort());
|
||||
|
||||
// 端口配置,支持随机端口
|
||||
int port = worker.getAkkaPort();
|
||||
if (port <= 0) {
|
||||
port = NetUtils.getRandomPort();
|
||||
}
|
||||
config.setPort(port);
|
||||
|
||||
// appName,需要提前在控制台注册,否则启动报错
|
||||
config.setAppName(worker.getAppName());
|
||||
config.setServerAddress(serverAddress);
|
||||
|
@ -1,10 +1,10 @@
|
||||
package com.github.kfcfans.powerjob.worker.common;
|
||||
|
||||
import com.github.kfcfans.powerjob.common.RemoteConstant;
|
||||
import com.github.kfcfans.powerjob.common.utils.NetUtils;
|
||||
import com.github.kfcfans.powerjob.worker.common.constants.StoreStrategy;
|
||||
import com.github.kfcfans.powerjob.worker.core.processor.ProcessResult;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
@ -15,6 +15,7 @@ import java.util.List;
|
||||
* @author tjq
|
||||
* @since 2020/3/16
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class OhMyConfig {
|
||||
/**
|
||||
@ -48,35 +49,4 @@ public class OhMyConfig {
|
||||
* true -> 用于本地写单元测试调试; false -> 默认值,标准模式
|
||||
*/
|
||||
private boolean enableTestMode = false;
|
||||
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
if (port > 0) {
|
||||
return port;
|
||||
}
|
||||
return NetUtils.getRandomPort();
|
||||
}
|
||||
|
||||
public List<String> getServerAddress() {
|
||||
return serverAddress;
|
||||
}
|
||||
|
||||
public StoreStrategy getStoreStrategy() {
|
||||
return storeStrategy;
|
||||
}
|
||||
|
||||
public int getMaxResultLength() {
|
||||
return maxResultLength;
|
||||
}
|
||||
|
||||
public Object getUserContext() {
|
||||
return userContext;
|
||||
}
|
||||
|
||||
public boolean isEnableTestMode() {
|
||||
return enableTestMode;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user