Last active
March 6, 2021 05:12
-
-
Save sheelprabhakar/84fb373fb6aa3187985218ab22087362 to your computer and use it in GitHub Desktop.
Spring boot application to execute a task every hour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
@EnableScheduling | |
public class Application { | |
@Autowired | |
private WeatherAgentService weatherAgentService; | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
//600000 | |
@Scheduled(fixedRate = 600000) | |
public void postWeather() { | |
this.weatherAgentService.update(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment