mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-05 01:43:22 +08:00
Refactor sessions and add locking to avoid concurrent requests to create
more instances
This commit is contained in:
@@ -49,11 +49,5 @@ func NewSession() (*types.Session, error) {
|
||||
|
||||
func GetSession(sessionId string) *types.Session {
|
||||
//TODO: Use redis
|
||||
s, found := sessions[sessionId]
|
||||
if found {
|
||||
s.Instances = instances[sessionId]
|
||||
return s
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
return sessions[sessionId]
|
||||
}
|
||||
|
Reference in New Issue
Block a user