Avoid submitting a job if executor is shutdown
There’s still a possiblilty of a race condition and we could catch and handle the exception, but this should reduce the noise a bit.
This commit is contained in:
parent
53962a3045
commit
296916a393
|
@ -171,7 +171,7 @@ public class DDAgentWriter implements Writer {
|
|||
}
|
||||
|
||||
private void scheduleFlush() {
|
||||
if (flushFrequencySeconds > 0) {
|
||||
if (flushFrequencySeconds > 0 && !scheduledWriterExecutor.isShutdown()) {
|
||||
final ScheduledFuture<?> previous =
|
||||
flushSchedule.getAndSet(
|
||||
scheduledWriterExecutor.schedule(flushTask, flushFrequencySeconds, SECONDS));
|
||||
|
|
Loading…
Reference in New Issue