fix: log output
This commit is contained in:
@@ -234,9 +234,11 @@ router.put('/groupchats/:target', async function (req, res) {
|
||||
if (has_subject) {
|
||||
if ( connection && connection.socket) {
|
||||
if (!connection.socket.writable) {
|
||||
console.log("connection not writable - trying to reconnect");
|
||||
await connection.connect(params).catch(error => {
|
||||
console.log("connection error: ", error);
|
||||
});
|
||||
console.log("reconnect result: ", connection.socket.writable);
|
||||
}
|
||||
if ( connection.socket.writable === false ) {
|
||||
res.status(500).json({message: 'telnet connection is not established.'});
|
||||
@@ -360,9 +362,11 @@ router.post('/affiliations/:target', async function (req, res) {
|
||||
if ( connection && connection.socket) {
|
||||
// try to re-establish connection
|
||||
if (!connection.socket.writable) {
|
||||
console.log("connection not writable - trying to reconnect");
|
||||
await connection.connect(params).catch(error => {
|
||||
console.log("connection error: ", error);
|
||||
});
|
||||
console.log("reconnect result: ", connection.socket.writable);
|
||||
}
|
||||
if ( connection.socket.writable === false ) {
|
||||
res.status(500).json({message: 'telnet connection is not established.'});
|
||||
|
||||
Reference in New Issue
Block a user