MCPcopy
hub / github.com/grafana/tempo / NewActiveUsersCleanupService

Function NewActiveUsersCleanupService

pkg/util/active_user.go:109–118  ·  view source on GitHub ↗
(cleanupInterval, inactiveTimeout time.Duration, cleanupFn func(string))

Source from the content-addressed store, hash-verified

107}
108
109func NewActiveUsersCleanupService(cleanupInterval, inactiveTimeout time.Duration, cleanupFn func(string)) *ActiveUsersCleanupService {
110 s := &ActiveUsersCleanupService{
111 activeUsers: NewActiveUsers(),
112 cleanupFunc: cleanupFn,
113 inactiveTimeout: inactiveTimeout,
114 }
115
116 s.Service = services.NewTimerService(cleanupInterval, nil, s.iteration, nil).WithName("active users cleanup")
117 return s
118}
119
120func (s *ActiveUsersCleanupService) UpdateUserTimestamp(user string, now time.Time) {
121 s.activeUsers.UpdateUserTimestamp(user, now.UnixNano())

Calls 1

NewActiveUsersFunction · 0.85

Tested by

no test coverage detected