@Scheduled Threads threads terminated?

I am wondering what will happen if I plan a Bean method with @Scheduled at, say, every hour, but the method takes more than one hour to complete.

Will the execution be completed?

+3
source share
1 answer

No, there is no mechanism that completes your thread. If the thread runs too long, this is your problem :-).

Note. You can use annotation @Scheduled(fixedDelay=xxx)only to start a new thread when the old thread ends. This avoids the parallel flow problem of multiple threads. However, a thread running too long or even freezing) may, of course, still cause other problems.

, , . - / , " ", , , . , , (. Thread.stop()).

+6

All Articles