Skip to content

Commit ae2681e

Browse files
committed
Only wait if there are instances
1 parent af8f6f7 commit ae2681e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitpod-network-check/cmd/common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ func cleanup(ctx context.Context, svc *ec2.Client, iamsvc *iam.Client) {
6060
}
6161

6262
if len(InstanceIds) > 0 {
63+
log.Info("Cleaning up: Waiting for 1 minute so network interfaces are deleted")
64+
time.Sleep(time.Minute)
65+
6366
_, err := svc.TerminateInstances(ctx, &ec2.TerminateInstancesInput{
6467
InstanceIds: InstanceIds,
6568
})
@@ -130,9 +133,6 @@ func cleanup(ctx context.Context, svc *ec2.Client, iamsvc *iam.Client) {
130133
log.Info("✅ Instance profile deleted")
131134
}
132135

133-
log.Info("Cleaning up: Waiting for 1 minute so network interfaces are deleted")
134-
time.Sleep(time.Minute)
135-
136136
if len(SecurityGroups) == 0 {
137137
securityGroups, err := svc.DescribeSecurityGroups(ctx, &ec2.DescribeSecurityGroupsInput{
138138
Filters: []types.Filter{

0 commit comments

Comments
 (0)