Refactor storage to support shallow types.

Add Client to storage.
Fix client resizing issues.
This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-09-01 20:12:19 -03:00
parent 4b00a9c0eb
commit 954c52471b
25 changed files with 1005 additions and 563 deletions

View File

@@ -161,9 +161,14 @@ func (s *scheduler) processSession(ctx context.Context, session *types.Session)
return
}
instances, err := s.storage.InstanceFindBySessionId(updatedSession.Id)
if err != nil {
log.Printf("Couldn't find instances for session [%s]. Got: %v\n", updatedSession.Id, err)
return
}
wg := sync.WaitGroup{}
wg.Add(len(updatedSession.Instances))
for _, ins := range updatedSession.Instances {
wg.Add(len(instances))
for _, ins := range instances {
go func(ins *types.Instance) {
s.processInstance(ctx, ins)
wg.Done()