Remove session lock as it's worthless now that PWD is deployed in (#204)
multiple servers
This commit is contained in:
committed by
Jonathan Leibiusky
parent
80fcf5abe3
commit
2cbde6d067
@@ -97,8 +97,6 @@ func (p *pwd) InstanceDelete(session *types.Session, instance *types.Instance) e
|
||||
|
||||
func (p *pwd) InstanceNew(session *types.Session, conf types.InstanceConfig) (*types.Instance, error) {
|
||||
defer observeAction("InstanceNew", time.Now())
|
||||
session.Lock()
|
||||
defer session.Unlock()
|
||||
|
||||
instances, err := p.storage.InstanceFindBySessionId(session.Id)
|
||||
if err != nil {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -16,13 +15,4 @@ type Session struct {
|
||||
ImageName string `json:"image_name" bson:"image_name"`
|
||||
Host string `json:"host" bson:"host"`
|
||||
UserId string `json:"user_id" bson:"user_id"`
|
||||
rw sync.Mutex `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Session) Lock() {
|
||||
s.rw.Lock()
|
||||
}
|
||||
|
||||
func (s *Session) Unlock() {
|
||||
s.rw.Unlock()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user