session销毁部分的time.AfterFunc函数问题
jking412 opened this issue · comments
jking412 commented
func (manager *Manager) GC() {
manager.lock.Lock()
defer manager.lock.Unlock()
time.AfterFunc(time.Duration(manager.maxLifeTime), func() { manager.provider.SessionGC(manager.maxLifeTime) })
}
time.AfterFunc
第一个时间参数的单位是纳秒,根据上下文信息,这里是否应该乘上time.Second
,如下所示
func (manager *Manager) GC() {
manager.lock.Lock()
defer manager.lock.Unlock()
time.AfterFunc(time.Duration(manager.maxLifeTime)*time.Second, func() { manager.provider.SessionGC(manager.maxLifeTime) })
}