mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-04 17:33:21 +08:00
Add session to list in the end
This commit is contained in:
@@ -230,8 +230,6 @@ func NewSession(duration time.Duration) (*Session, error) {
|
||||
s.ExpiresAt = s.CreatedAt.Add(duration)
|
||||
log.Printf("NewSession id=[%s]\n", s.Id)
|
||||
|
||||
sessions[s.Id] = s
|
||||
|
||||
// Schedule cleanup of the session
|
||||
CloseSessionAfter(s, duration)
|
||||
|
||||
@@ -253,6 +251,8 @@ func NewSession(duration time.Duration) (*Session, error) {
|
||||
// Schedule peridic tasks execution
|
||||
s.SchedulePeriodicTasks()
|
||||
|
||||
sessions[s.Id] = s
|
||||
|
||||
// We store sessions as soon as we create one so we don't delete new sessions on an api restart
|
||||
if err := saveSessionsToDisk(); err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user