|
|
|
@ -35,7 +35,7 @@ type SessionManager struct {
|
|
|
|
type Session struct {
|
|
|
|
type Session struct {
|
|
|
|
Data map[string]interface{}
|
|
|
|
Data map[string]interface{}
|
|
|
|
timer *time.Timer
|
|
|
|
timer *time.Timer
|
|
|
|
mu sync.Mutex
|
|
|
|
mu *sync.Mutex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// NewSessionManager creates a new sessionManager
|
|
|
|
// NewSessionManager creates a new sessionManager
|
|
|
|
@ -66,6 +66,7 @@ func (m *SessionManager) CreateSession() (string, error) {
|
|
|
|
timer: time.AfterFunc(5*time.Second, func() {
|
|
|
|
timer: time.AfterFunc(5*time.Second, func() {
|
|
|
|
m.CleanSession(sessionID)
|
|
|
|
m.CleanSession(sessionID)
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|
|
|
|
mu: &sync.Mutex{},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m.rwmu.Unlock()
|
|
|
|
m.rwmu.Unlock()
|
|
|
|
|
|
|
|
|
|
|
|
|