mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 18:27:25 +08:00
Add session to list in the end
This commit is contained in:
parent
e8903896d1
commit
6fba4f3b3a
@ -230,8 +230,6 @@ func NewSession(duration time.Duration) (*Session, error) {
|
|||||||
s.ExpiresAt = s.CreatedAt.Add(duration)
|
s.ExpiresAt = s.CreatedAt.Add(duration)
|
||||||
log.Printf("NewSession id=[%s]\n", s.Id)
|
log.Printf("NewSession id=[%s]\n", s.Id)
|
||||||
|
|
||||||
sessions[s.Id] = s
|
|
||||||
|
|
||||||
// Schedule cleanup of the session
|
// Schedule cleanup of the session
|
||||||
CloseSessionAfter(s, duration)
|
CloseSessionAfter(s, duration)
|
||||||
|
|
||||||
@ -253,6 +251,8 @@ func NewSession(duration time.Duration) (*Session, error) {
|
|||||||
// Schedule peridic tasks execution
|
// Schedule peridic tasks execution
|
||||||
s.SchedulePeriodicTasks()
|
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
|
// 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 {
|
if err := saveSessionsToDisk(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user