正式环境执行
This commit is contained in:
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -20,6 +21,7 @@ import java.util.List;
|
||||
|
||||
@Component
|
||||
@EnableScheduling
|
||||
@Profile({"prod"})
|
||||
public class SpinningTask3 {
|
||||
|
||||
@Resource
|
||||
@@ -27,16 +29,11 @@ public class SpinningTask3 {
|
||||
@Resource
|
||||
private DiscSpinningRecordService recordService;
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String profiles;
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Scheduled(cron = "0 0/5 * * * ? ")
|
||||
@Scheduled(cron = "0 0/1 * * * ? ")
|
||||
public void record() {
|
||||
if (!"prod".equals(profiles)) {
|
||||
return;
|
||||
}
|
||||
record("1");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user