()
| 138 | } |
| 139 | |
| 140 | func (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 | |
| 150 | func (t *IPTracker) prepareRecordUnsafe(ip string, record *IPRecord) bool { |
| 151 | if time.Since(record.LastUpdate) > ExpireDuration { |
no outgoing calls
no test coverage detected