title: How to reset scheduled (@Scheduled) in spring boot
body: <p>I have spring boot application, where I need to refresh every 20 seconds so I created this:</p>
  <pre><code>@Scheduled(cron=&quot;*/20 * * * * *&quot;)
  @GetMapping(&quot;/refresh&quot;)
  public void refresh(){
      letterServiceI.refreshQueue();
  }
  </code></pre>
  <p>And it works perfectly, but when I am adding row to database and before it was empty I want to reset timer to 20 seconds again, is there a way to do it?</p>
  <pre><code>@Override
  public Letter add(String name, String content, String pin) {
  
      if (letterRepositoryI.checkIfNotEmpty().isEmpty()){
          //if empty -&gt; reset scheduler to 20 again
          
      }
  </code></pre>