fix: log output

This commit is contained in:
2021-09-14 13:50:39 +02:00
parent ca62fb8682
commit 62d2e25c5b
+4
View File
@@ -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.'});