Skip to content

Commit

Permalink
Only start instances when we have instance ids
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVerschueren committed Sep 18, 2017
1 parent 9421113 commit 8394467
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/controllers/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ const ec2 = new AWS.EC2();
const startInstances = pify(ec2.startInstances.bind(ec2));

export async function start(ctx, instanceIds: number[]) {
const params = {
InstanceIds: instanceIds
};
console.log(`Starting ${instanceIds.length} servers with group \`${ctx.request.params.group}\``);

return await startInstances(params);
if (instanceIds.length > 0) {
const params = {
InstanceIds: instanceIds
};

return await startInstances(params);
}
}

0 comments on commit 8394467

Please sign in to comment.