设置定时任务prod环境

master
chenxiwang 2024-07-23 10:20:32 +08:00
parent 5445eefe09
commit 8199b3e63d
1 changed files with 2 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
@ -64,6 +65,7 @@ import ru.olegcherednik.jackson_utils.JacksonUtils;
@EnableScheduling//开启定时任务 @EnableScheduling//开启定时任务
@Component @Component
@Slf4j @Slf4j
@Profile("prod")
public class DataTask { public class DataTask {
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static SimpleDateFormat sdfD = new SimpleDateFormat("yyyy-MM-dd"); private static SimpleDateFormat sdfD = new SimpleDateFormat("yyyy-MM-dd");