Skip to content

Commit

Permalink
contracts: update root cache upon renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed May 8, 2024
1 parent 83884e6 commit 7684597
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions host/contracts/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ func (cm *ContractManager) RenewContract(renewal SignedRevision, existing Signed
return err
}
cm.log.Debug("contract renewed", zap.Stringer("renewalID", renewal.Revision.ParentID), zap.Stringer("existingID", existing.Revision.ParentID))

// update roots cache
roots, ok := cm.rootsCache.Get(existing.Revision.ParentID)
if ok {
cm.rootsCache.Add(renewal.Revision.ParentID, roots)
cm.rootsCache.Remove(existing.Revision.ParentID)
}
return nil
}

Expand Down

0 comments on commit 7684597

Please sign in to comment.