From cfc03b28264a448b2958f4a88c98521966e1a547 Mon Sep 17 00:00:00 2001 From: "Jonathan Leibiusky @xetorthio" Date: Wed, 9 Aug 2017 18:16:55 -0300 Subject: [PATCH] Always get instance from storage --- pwd/instance.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pwd/instance.go b/pwd/instance.go index 0953cd6..5c65001 100644 --- a/pwd/instance.go +++ b/pwd/instance.go @@ -52,7 +52,12 @@ func (p *pwd) InstanceUploadFromReader(instance *types.Instance, fileName, dest func (p *pwd) InstanceGet(session *types.Session, name string) *types.Instance { defer observeAction("InstanceGet", time.Now()) - return session.Instances[name] + instance, err := p.storage.InstanceGet(session.Id, name) + if err != nil { + log.Println(err) + return nil + } + return instance } func (p *pwd) InstanceFindByIP(sessionId, ip string) *types.Instance {