Refactor center
This commit is contained in:
@@ -28,7 +28,6 @@ if (options.help) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
|
||||
verifyDefaults(options, centerOptions);
|
||||
verifyExists(options.port, "Port can not be undefined or empty! (--port)", logger);
|
||||
verifyExists(options.systemid, "SystemID can not be undefined or empty! (--systemid)", logger);
|
||||
@@ -63,11 +62,13 @@ function startInterval(session, sessionLogger, rxMetrics) {
|
||||
short_message: options.message,
|
||||
});
|
||||
|
||||
sendPdu(session, pdu).then(resp => {
|
||||
sendPdu(session, pdu, sessionLogger, options.longsms)
|
||||
.then((resp) => {
|
||||
inFlight--;
|
||||
sessionLogger.info(`Received response with id ${resp.message_id}`);
|
||||
success++;
|
||||
}).catch(resp => {
|
||||
})
|
||||
.catch((resp) => {
|
||||
inFlight--;
|
||||
sessionLogger.warn(`Message failed with id ${resp.message_id}`);
|
||||
failed++;
|
||||
|
Reference in New Issue
Block a user