Skip to content

Commit e5f5d01

Browse files
committed
Fixed new strategies not getting their container channel init
1 parent aaafae4 commit e5f5d01

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tournament.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,6 @@ func (s *Strategy) bufferContainers(exit chan bool) {
145145
default:
146146
break
147147
}
148-
//log.WithFields(log.Fields{
149-
// "prefix": "strategy",
150-
// "name": s.Name,
151-
// "id": s.ID,
152-
//}).Debug("Creating strategy...")
153148
tempContainer := createContainer()
154149
err := exec.Command("docker", "cp", s.Path, tempContainer.id+":/code").Run()
155150
if err != nil {
@@ -168,6 +163,10 @@ func (tm *TournamentManager) add(strategy *Strategy) {
168163
tm.pairings[[2]*Strategy{strategy, oldStrat}] = 0
169164
tm.pairings[[2]*Strategy{oldStrat, strategy}] = 0
170165
}
166+
strategy.containers = make(chan container, 5)
167+
exit := make(chan bool, 1)
168+
tm.exits = append(tm.exits, exit)
169+
go strategy.bufferContainers(exit)
171170
}
172171

173172
func (tm *TournamentManager) run() {

0 commit comments

Comments
 (0)