MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / IsExpired

Method IsExpired

internal/utils/counters/item.go:118–120  ·  view source on GitHub ↗
(currentTime int64)

Source from the content-addressed store, hash-verified

116}
117
118func (this *Item[T]) IsExpired(currentTime int64) bool {
119 return this.lastUpdateTime < currentTime-this.lifeSeconds-this.spanSeconds
120}
121
122func (this *Item[T]) calculateSpanIndex(timestamp int64) int {
123 var index = int(timestamp % this.lifeSeconds / this.spanSeconds)

Callers 2

GCMethod · 0.45
TestItem_IsExpiredFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestItem_IsExpiredFunction · 0.36