Skip to content

fix online list request#204

Open
banshiAnton wants to merge 13 commits intodevelopmentfrom
fix-online-list
Open

fix online list request#204
banshiAnton wants to merge 13 commits intodevelopmentfrom
fix-online-list

Conversation

@banshiAnton
Copy link
Copy Markdown
Collaborator

No description provided.

export const watchdogPingSocket = async (logger, sessionService, onWsCloseCb, onTcpCloseCb) => {
const users = Object.keys(sessionService.activeSessions.DEVICES)

logger.debug("[run] %s", users.length)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.debug("[watchdogPingSocket][run] %s", users.length)

connection.socket?.send(pingPackage)
}
} catch (error) {
logger.error(error, "[error socket send] %s", userId)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.error(error, "[watchdogPingSocket][error socket send] %s", userId)

if (isTCP) {
await onTcpCloseCb(connection?.socket)
.then(() => logger.debug("[close tcp done] %s", userId))
.catch(error => logger.error(error, "[close tcp error]"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.catch(error => logger.error(error, "[watchdogPingSocket][close tcp error]"))

} else {
await onWsCloseCb(connection?.socket, 10)
.then(() => logger.debug("[close ws done] %s", userId))
.catch(error => logger.error(error, "[close ws error]"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.catch(error => logger.error(error, "[watchdogPingSocket][close ws error]"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants