Answer the question
In order to leave comments, you need to log in
Why is the method called twice in the ExecutorService in the run block?
The request to help to make so that run was fulfilled only once.
final ExecutorService executor = Executors.newFixedThreadPool(1);
executor.execute(new Runnable()
{
public void run()
{
try
{
test();
}
catch (Exception e)
{
log.error("Ошибка во время запуска", e);
}
finally
{
}
}
});
if (!executor.awaitTermination(10, TimeUnit.SECONDS))
{
executor.shutdownNow();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question