Skip to content

Commit ed23e84

Browse files
feat: document function
1 parent 99ca80b commit ed23e84

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

controllers/cache_handler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,8 @@ func (r *DisruptionReconciler) clearExpiredCacheContexts() {
583583
}
584584
}
585585

586+
// cacheDeletionSafety is thought to be run in a goroutine to assert a cache is not running without its disruption
587+
// the polling is living on the cache context, meaning if it's deleted elsewhere this function will return early.
586588
func (r *DisruptionReconciler) cacheDeletionSafety(ctxTpl CtxTuple, disHash string) {
587589
_ = wait.PollInfiniteWithContext(ctxTpl.Ctx, time.Minute, func(context.Context) (bool, error) {
588590
if err := r.Get(ctxTpl.Ctx, ctxTpl.DisruptionNamespacedName, &chaosv1beta1.Disruption{}); err != nil {

0 commit comments

Comments
 (0)