Remove session lock as it's worthless now that PWD is deployed in (#204)

multiple servers
This commit is contained in:
Marcos Nils
2017-11-02 14:20:14 -03:00
committed by Jonathan Leibiusky
parent 80fcf5abe3
commit 2cbde6d067
2 changed files with 10 additions and 22 deletions

View File

@@ -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 {

View File

@@ -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()
}