Skip to content

Commit

Permalink
Remove report update caching
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Oct 11, 2021
1 parent f2c1fb6 commit f00b8b9
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/main/java/com/ververica/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ public class Core implements AutoCloseable {
.expireAfterWrite(1, TimeUnit.HOURS)
.build();

private final Cache<Long, Boolean> pendingCiReportUpdates = CacheBuilder.newBuilder()
.maximumSize(1000)
.expireAfterWrite(1, TimeUnit.HOURS)
.build();

public Core(String observedRepository, String ciRepository, String username, String githubToken, GitActions gitActions, GitHubActions gitHubActions, CiActionsContainer ciActions, String gitHubCheckerNameFilter) throws Exception {
this.observedRepository = observedRepository;
this.ciRepository = ciRepository;
Expand Down Expand Up @@ -171,12 +166,6 @@ public void close() {

public void updateCiReport(final CiReport parsedCiReport) throws IOException {
final String comment = parsedCiReport.toString();
final long cacheKey = (long) parsedCiReport.getPullRequestID() << 32 | comment.hashCode();
if (pendingCiReportUpdates.getIfPresent(cacheKey) != null) {
LOG.debug("Ignoring ci report update for PR {} due to being cached.", formatPullRequestID(parsedCiReport.getPullRequestID()));
return;
}
pendingCiReportUpdates.put(cacheKey, true);

final int pullRequestID = parsedCiReport.getPullRequestID();
Optional<GitHubComment> ciReport = getCiReportComment(pullRequestID);
Expand Down

0 comments on commit f00b8b9

Please sign in to comment.