(cleanupInterval, inactiveTimeout time.Duration, cleanupFn func(string))
| 120 | } |
| 121 | |
| 122 | func NewActiveUsersCleanupService(cleanupInterval, inactiveTimeout time.Duration, cleanupFn func(string)) *ActiveUsersCleanupService { |
| 123 | s := &ActiveUsersCleanupService{ |
| 124 | activeUsers: NewActiveUsers(), |
| 125 | cleanupFunc: cleanupFn, |
| 126 | inactiveTimeout: inactiveTimeout, |
| 127 | } |
| 128 | |
| 129 | s.Service = services.NewTimerService(cleanupInterval, nil, s.iteration, nil).WithName("active users cleanup") |
| 130 | return s |
| 131 | } |
| 132 | |
| 133 | func (s *ActiveUsersCleanupService) UpdateUserTimestamp(user string, now time.Time) { |
| 134 | s.activeUsers.UpdateUserTimestamp(user, now.UnixNano()) |
no test coverage detected