正式环境执行
This commit is contained in:
parent
c5d25a879a
commit
7811a9b4af
|
|
@ -37,9 +37,6 @@ import java.util.*;
|
||||||
@ConfigurationProperties(prefix = "spring.shardingsphere")
|
@ConfigurationProperties(prefix = "spring.shardingsphere")
|
||||||
public class ShardingConfig {
|
public class ShardingConfig {
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
|
||||||
private String activeProfile;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取数据源信息
|
* 读取数据源信息
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,6 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||||
private final UserVipDao userVipDao;
|
private final UserVipDao userVipDao;
|
||||||
private final InviteAchievementService inviteAchievementService;
|
private final InviteAchievementService inviteAchievementService;
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
|
||||||
private String profiles;
|
|
||||||
|
|
||||||
private ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock(true);
|
private ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock(true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -20,6 +21,7 @@ import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
|
@Profile({"prod"})
|
||||||
public class SpinningTask3 {
|
public class SpinningTask3 {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -27,16 +29,11 @@ public class SpinningTask3 {
|
||||||
@Resource
|
@Resource
|
||||||
private DiscSpinningRecordService recordService;
|
private DiscSpinningRecordService recordService;
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
|
||||||
private String profiles;
|
|
||||||
|
|
||||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
@Scheduled(cron = "0 0/5 * * * ? ")
|
@Scheduled(cron = "0 0/1 * * * ? ")
|
||||||
public void record() {
|
public void record() {
|
||||||
if (!"prod".equals(profiles)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
record("1");
|
record("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue