Tested code. As others suggest, the result is: Deleting a row
files.cancel(false);
makes it run every minute. Otherwise, it starts only once.
Here is my code for a test that works:
import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; public class PeriodicCall { public static void main(String args[]) { new PeriodicCall().poll(); } public void poll() { System.out.println("poll");
My run () function only contains System.out.println, so you should check your code inside the run () method. If it contains errors, it will abort everything.
source share