MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / removeOldestUnsafe

Method removeOldestUnsafe

core/init/auth/ip_tracker.go:140–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138}
139
140func (t *IPTracker) removeOldestUnsafe() {
141 if len(t.ipOrder) == 0 {
142 return
143 }
144
145 oldestIP := t.ipOrder[0]
146 delete(t.records, oldestIP)
147 t.ipOrder = t.ipOrder[1:]
148}
149
150func (t *IPTracker) prepareRecordUnsafe(ip string, record *IPRecord) bool {
151 if time.Since(record.LastUpdate) > ExpireDuration {

Callers 2

SetNeedCaptchaMethod · 0.95
RecordFailureMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected