You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/06/26 10:58:25 UTC
[ignite-teamcity-bot] branch master updated: Fix of too-short
history: negative values in build start time cache fix
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/master by this push:
new 9801cc6 Fix of too-short history: negative values in build start time cache fix
9801cc6 is described below
commit 9801cc649353390cf0e76b8bdeb808100d443bac
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Wed Jun 26 13:58:18 2019 +0300
Fix of too-short history: negative values in build start time cache fix
---
.../ignite/tcignited/history/RunHistCompactedDao.java | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunHistCompactedDao.java b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunHistCompactedDao.java
index ffc0c47..27dc742 100644
--- a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunHistCompactedDao.java
+++ b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunHistCompactedDao.java
@@ -141,11 +141,18 @@ public class RunHistCompactedDao {
*/
@AutoProfiling
@Nullable public Long getBuildStartTime(int srvId, int buildId) {
- return buildStartTime.get(buildIdToCacheKey(srvId, buildId));
+ Long ts = buildStartTime.get(buildIdToCacheKey(srvId, buildId));
+ if (ts == null || ts <= 0)
+ return null;
+
+ return ts;
}
@AutoProfiling
public boolean setBuildProcessed(int srvId, int buildId, long ts) {
+ if (ts <= 0)
+ return false;
+
return buildStartTime.putIfAbsent(buildIdToCacheKey(srvId, buildId), ts);
}
@@ -253,8 +260,9 @@ public class RunHistCompactedDao {
Map<Integer, Long> res = new HashMap<>();
- buildStartTime.getAll(cacheKeys).forEach((k, r) -> {
- res.put(BuildRefDao.cacheKeyToBuildId(k), r);
+ buildStartTime.getAll(cacheKeys).forEach((k, ts) -> {
+ if (ts != null && ts > 0)
+ res.put(BuildRefDao.cacheKeyToBuildId(k), ts);
});
return res;
@@ -264,7 +272,7 @@ public class RunHistCompactedDao {
Map<Long, Long> res = new HashMap<>();
builds.forEach((buildId, ts) -> {
- if (ts != null)
+ if (ts != null && ts > 0)
res.put(buildIdToCacheKey(srvId, buildId), ts);
});