MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / cleanup

Function cleanup

twitterv1/auth.go:437–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

435}
436
437func cleanup() {
438 for {
439 time.Sleep(cleanupInterval)
440 now := time.Now()
441 manager.locks.Range(func(key, value interface{}) bool {
442 if lock, ok := value.(*lockInfo); ok {
443 if now.Sub(lock.lastAccess) > cleanupInterval {
444 manager.locks.Delete(key)
445 }
446 }
447 return true
448 })
449 }
450}
451
452func GetLock(userDID string) *sync.Mutex {
453 lock, _ := manager.locks.LoadOrStore(userDID, &lockInfo{

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected