未验证 提交 f1c7e939 编写于 作者: W Wan Kai 提交者: GitHub

Fix miss set `LastUpdateTimestamp` that caused the metrics session to expire (#10111)

上级 d6fa688f
......@@ -25,6 +25,7 @@
* Correct `MetricsExtension` annotations declarations in manual entities.
* Support component IDs' priority in process relation metrics.
* Remove abandon logic in MergableBufferedData, which caused unexpected no-update.
* Fix miss set `LastUpdateTimestamp` that caused the metrics session to expire.
#### UI
......
......@@ -247,6 +247,7 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
for (Metrics metrics : metricsList) {
Metrics cachedMetrics = sessionCache.get(metrics);
if (cachedMetrics != null) {
cachedMetrics.setLastUpdateTimestamp(timestamp);
/*
* If the metrics is not supportUpdate, defined through MetricsExtension#supportUpdate,
* then no merge and further process happens.
......@@ -269,7 +270,6 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
new SessionCacheCallback(sessionCache, cachedMetrics)
));
nextWorker(cachedMetrics);
cachedMetrics.setLastUpdateTimestamp(timestamp);
} else {
metrics.calculate();
prepareRequests.add(
......@@ -339,8 +339,10 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
if (notInCacheMetrics.isEmpty()) {
return;
}
metricsDAO.multiGet(model, notInCacheMetrics).forEach(m -> sessionCache.put(m));
metricsDAO.multiGet(model, notInCacheMetrics).forEach(m -> {
m.setLastUpdateTimestamp(currentTimeMillis);
sessionCache.put(m);
});
} catch (final Exception e) {
log.error("Failed to load metrics for merging", e);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册