Skip to content

Commit

Permalink
Merge pull request #12 from telekom/fix-loop-detection
Browse files Browse the repository at this point in the history
Set lastOpened in loop detection
  • Loading branch information
WRichter72 authored Aug 23, 2024
2 parents 3c18490 + 76072cf commit f55fd52
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/circuitbreaker/circuitbreaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ func checkForCircuitBreakerLoop(cbMessage *message.CircuitBreakerMessage) error
cbMessage.LoopCounter = 0
log.Debug().Msgf("Circuit breaker opened outside loop detection period. Reseted loop counter for subscription %s: %v", cbMessage.SubscriptionId, cbMessage.LoopCounter)
}
// set last opened for the next loop detection
cbMessage.LastOpened = cbMessage.LastModified
cbMessage.LastModified = types.NewTimestamp(time.Now().UTC())

err := cache.CircuitBreakerCache.Put(config.Current.Hazelcast.Caches.CircuitBreakerCache, cbMessage.SubscriptionId, *cbMessage)
Expand Down

0 comments on commit f55fd52

Please sign in to comment.