-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Closed
Description
InstanceConfigAuditUtil#afterPropertiesSet
@Override
public void afterPropertiesSet() throws Exception {
auditExecutorService.submit(() -> {
while (!auditStopped.get() && !Thread.currentThread().isInterrupted()) {
try {
InstanceConfigAuditModel model = audits.poll();
if (model == null) {
TimeUnit.SECONDS.sleep(1);
continue;
}
doAudit(model);
} catch (Throwable ex) {
Tracer.logError(ex);
}
}
});
}
It's better to use audits#take :
@Override
public void afterPropertiesSet() throws Exception {
auditExecutorService.submit(() -> {
while (!auditStopped.get() && !Thread.currentThread().isInterrupted()) {
try {
InstanceConfigAuditModel model = audits.take();
doAudit(model);
} catch (Throwable ex) {
Tracer.logError(ex);
}
}
});
}
Metadata
Metadata
Assignees
Labels
No labels