Skip to content

Instantly share code, notes, and snippets.

@bruskiza
Created March 1, 2020 09:44
Show Gist options
  • Save bruskiza/3eb7f0f75191cc2b19a754d413ea5915 to your computer and use it in GitHub Desktop.
Save bruskiza/3eb7f0f75191cc2b19a754d413ea5915 to your computer and use it in GitHub Desktop.
@Scheduled(fixedRate = 5000)
public void doSomething() throws Exception {
log.info("Scheduled task run...");
File resource = new ClassPathResource("static/index.html").getFile();
String time = String.valueOf(Instant.now().toEpochMilli());
StringBuilder sb = new StringBuilder();
sb.append("<p>");
sb.append(time);
Files.write(resource.toPath(), sb.toString().getBytes());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment