mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-07-24 12:51:55 +00:00
fix jslint issue
This commit is contained in:
+23
-16
@@ -6,9 +6,15 @@ const {LifeCycleEvents} = require('./constants');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const getString = bent('string');
|
||||
import { SNSClient, SubscribeCommand, UnsubscribeCommand } from "@aws-sdk/client-sns";
|
||||
const {
|
||||
SNSClient,
|
||||
SubscribeCommand,
|
||||
UnsubscribeCommand } = require('@aws-sdk/client-sns');
|
||||
const snsClient = new SNSClient({ region: process.env.AWS_REGION, apiVersion: '2010-03-31' });
|
||||
import { AutoScalingClient, DescribeAutoScalingGroupsCommand, CompleteLifecycleActionCommand } from "@aws-sdk/client-auto-scaling";
|
||||
const {
|
||||
AutoScalingClient,
|
||||
DescribeAutoScalingGroupsCommand,
|
||||
CompleteLifecycleActionCommand } = require('@aws-sdk/client-auto-scaling');
|
||||
const autoScalingClient = new AutoScalingClient({ region: process.env.AWS_REGION, apiVersion: '2011-01-01' });
|
||||
const {Parser} = require('xml2js');
|
||||
const parser = new Parser();
|
||||
@@ -157,12 +163,13 @@ class SnsNotifier extends Emitter {
|
||||
completeScaleIn() {
|
||||
assert(this.scaleInParams);
|
||||
autoScalingClient.send(new CompleteLifecycleActionCommand(this.scaleInParams))
|
||||
.then(() => {
|
||||
this.logger.info({response}, 'Successfully completed scale-in action');
|
||||
})
|
||||
.catch((err) => {
|
||||
this.logger.error({err}, 'Error completing scale-in');
|
||||
})
|
||||
.then((data) => {
|
||||
this.logger.info({data}, 'Successfully completed scale-in action');
|
||||
return 0;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.logger.error({err}, 'Error completing scale-in');
|
||||
});
|
||||
}
|
||||
|
||||
describeInstance() {
|
||||
@@ -171,14 +178,14 @@ class SnsNotifier extends Emitter {
|
||||
autoScalingClient.send(new DescribeAutoScalingGroupsCommand({
|
||||
InstanceIds: [this.instanceId]
|
||||
}))
|
||||
.then((data) => {
|
||||
this.logger.info({data}, 'SnsNotifier: describeInstance');
|
||||
resolve(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
his.logger.error({err}, 'Error describing instances');
|
||||
reject(err);
|
||||
})
|
||||
.then((data) => {
|
||||
this.logger.info({data}, 'SnsNotifier: describeInstance');
|
||||
return resolve(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.logger.error({err}, 'Error describing instances');
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user