Skip to content

Commit

Permalink
https://github.com/DP-3T/dp3t-sdk-backend/issues/192
Browse files Browse the repository at this point in the history
  • Loading branch information
ubamrein committed Jul 14, 2020
1 parent ec8ef7e commit a2c4dd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ public void upsertExposeesDelayed(List<GaenKey> gaenKeys, OffsetDateTime delayed
}
var parameterList = new ArrayList<MapSqlParameterSource>();
var nowMillis = System.currentTimeMillis();
//if delayedReceivedAt is supplied use it
// if delayedReceivedAt is supplied use it
// else we calculate the last moment of the current bucket like this:
// currentBucketNumber = Floor(now/releaseBucketDuration)
// nextBucketNumber = currentBucketNumber + 1
// nextBucket = nextBucketNumber * releaseBucketDuration
// Since we have millisecond precision => lastMomentOfCurrentBucket = nextBucket - 1
var receivedAt = delayedReceivedAt == null? (nowMillis/releaseBucketDuration.toMillis() + 1) * releaseBucketDuration.toMillis() - 1 : delayedReceivedAt.toInstant().toEpochMilli();
for (var gaenKey : gaenKeys) {
MapSqlParameterSource params = new MapSqlParameterSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ public GaenController(GAENDataService dataService, FakeKeyService fakeKeyService
}

if(delayTodaysKeys) {
// Additionally to delaying keys this feature also make sure rolling period is always set to 144
// to make sure iOS 13.5.x does not ignore the TEK.
// Additionally to delaying keys this feature also makes sure rolling period is always set to 144
// to make sure iOS 13.5.x does not ignore the TEK. The calculations of the RPIs should still be true,
// though more keys might be checked.
key.setRollingPeriod(GaenKey.GaenKeyDefaultRollingPeriod);

var rollingStartNumberDuration = Duration.of(key.getRollingStartNumber(), GaenUnit.TenMinutes).toMillis();
Expand Down

0 comments on commit a2c4dd1

Please sign in to comment.