Commit 78c968c3124f66bd482472fbfa9a6d646950fce4
1 parent
ad290d9cd1
Exists in
master
Add clients.hasActiveWs
Showing 1 changed file with 10 additions and 0 deletions Side-by-side Diff
client.js
... | ... | @@ -2,4 +2,14 @@ require('./lib/client'); |
2 | 2 | |
3 | 3 | const pushTaskPrepaid = require('./lib/client/push-task-prepaid'); |
4 | 4 | |
5 | +const wsList = require('./lib/client/ws-list'); | |
6 | + | |
5 | 7 | exports.pushTaskPrepaid = pushTaskPrepaid; |
8 | + | |
9 | +/** | |
10 | + * Check if gateway has valid active websocket | |
11 | + * | |
12 | + * @param {string} gatewayName | |
13 | + * @returns {boolean} | |
14 | + */ | |
15 | +exports.hasActiveWs = (gatewayName) => !!wsList[gatewayName]; |