Skip to content

Commit

Permalink
server: update for expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0Vu committed Aug 8, 2023
1 parent dac9199 commit bbf801f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions server/internal/pki/pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,10 @@ func (p *pki) publishDescriptorIfNeeded(pkiCtx context.Context) error {
}
if till < publishGracePeriod {
// check whether the certificate is expired and the network stuck
if p.lastPublishedEpoch > 0 {
if epoch > 0 && (epoch-p.lastPublishedEpoch) > s11n.CertificateExpiration {
// Should we republish epoch + 1?
p.log.Debugf("Publish epoch again: %d.", epoch)
p.lastPublishedEpoch = 0
}
if p.lastPublishedEpoch > 0 && (epoch > 0 && (epoch-p.lastPublishedEpoch) > s11n.CertificateExpiration) {
// Should we republish epoch + 1?
p.log.Debugf("Publish epoch again: %d.", epoch)
p.lastPublishedEpoch = 0
} else {
epoch++
}
Expand Down

0 comments on commit bbf801f

Please sign in to comment.