Exporter INCREMENT mode is not working. (#5220)

This commit is contained in:
吴晟 Wu Sheng 2020-08-03 06:53:00 +08:00 committed by GitHub
parent 118e334e7c
commit 0146aa522f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -176,17 +176,17 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
cachedMetrics.calculate();
prepareRequests.add(metricsDAO.prepareBatchUpdate(model, cachedMetrics));
nextWorker(cachedMetrics);
/*
* The `data` should be not changed in any case. Exporter is an async process.
*/
nextExportWorker.ifPresent(exportEvenWorker -> exportEvenWorker.in(
new ExportEvent(metrics, ExportEvent.EventType.INCREMENT)));
} else {
metrics.calculate();
prepareRequests.add(metricsDAO.prepareBatchInsert(model, metrics));
nextWorker(metrics);
}
/*
* The `metrics` should be not changed in all above process. Exporter is an async process.
*/
nextExportWorker.ifPresent(exportEvenWorker -> exportEvenWorker.in(
new ExportEvent(metrics, ExportEvent.EventType.INCREMENT)));
}
} catch (Throwable t) {
log.error(t.getMessage(), t);