Skip to content

Commit

Permalink
Fix racy behavior and remove redundant system call to get the time. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mattl-netflix authored Jul 7, 2022
1 parent a79b662 commit 4d1d0ab
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private Instant getUploadTarget() {
CronExpression snapshotCron =
new CronExpression(backupRestoreConfig.getSnapshotMetaServiceCronExpression());
snapshotCron.setTimeZone(UTC);
Date nextSnapshotDate = snapshotCron.getNextValidTimeAfter(Date.from(Instant.now()));
Date nextSnapshotDate = snapshotCron.getNextValidTimeAfter(Date.from(now));
nextSnapshotTime =
nextSnapshotDate == null ? Instant.MAX : nextSnapshotDate.toInstant();
} catch (ParseException e) {
Expand Down

0 comments on commit 4d1d0ab

Please sign in to comment.