Skip to content

Commit 6d12008

Browse files
committed
Kill instances for running challenges
1 parent 32433a3 commit 6d12008

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/beast/run.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ func cleanupRunningContainers() {
5656

5757
for _, challenge := range challenges {
5858
if challenge.Status == core.DEPLOY_STATUS["deployed"] {
59+
if challenge.Instanced {
60+
_ = manager.KillChallengeInstances(challenge.Name)
61+
}
62+
5963
err = manager.UndeployChallenge(challenge.Name)
6064
if err != nil {
6165
log.Errorln(fmt.Sprintf("Failed to undeploy challenge [Id: %v] %s", challenge.ID, challenge.Name))
@@ -152,13 +156,13 @@ func cleanup() {
152156
stopSseNotificationHub()
153157
stopApiScheduler()
154158

159+
cleanupRunningContainers()
160+
155161
stopWorkerQueue()
156162
stopRemoteManagers()
157163

158164
saveLeaderboardCache()
159165

160-
cleanupRunningContainers()
161-
162166
cleanupCacheConnections()
163167
cleanupDatabaseConnections()
164168

0 commit comments

Comments
 (0)