MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / evictSequences

Method evictSequences

worker/db_storage.go:157–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155}
156
157func (db *Database) evictSequences() {
158 m := make(map[uint64]*list.Element)
159 l := list.New()
160
161 for connSeq := range db.connSeqEvictCh {
162 if e, ok := m[connSeq]; ok {
163 l.MoveToFront(e)
164 return
165 }
166
167 e := l.PushFront(connSeq)
168 m[connSeq] = e
169
170 if l.Len() > MaxRecordedConnectionSequences {
171 e = l.Back()
172 if e != nil {
173 l.Remove(e)
174 evictSeq := e.Value.(uint64)
175 delete(m, evictSeq)
176 db.connSeqs.Delete(evictSeq)
177 }
178 }
179 }
180}

Callers 1

NewDatabaseFunction · 0.80

Calls 4

DeleteMethod · 0.80
NewMethod · 0.65
LenMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected