Commit a7a61432 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

feat: prevent repetative time.Now() computation in loop

parent 20ab9b42
......@@ -58,10 +58,11 @@ func (s *MemorySessionStore) get(token string) *Sessiondata {
}
func (s *MemorySessionStore) flush() {
now := time.Now()
s.Lock()
defer s.Unlock()
for k, v := range s.data {
if time.Now().After(v.expiry) {
if now.After(v.expiry) {
delete(s.data, k)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment