(socketId, callback)
| 17 | * @callback : A sessionID which is a string.. |
| 18 | */ |
| 19 | getSession(socketId, callback) { |
| 20 | try { |
| 21 | config.redisClient.get(`cb-socket-${socketId}`, (err, reply) => { |
| 22 | if (reply) { |
| 23 | sessionHelper.getSession(reply, callback); |
| 24 | } else if (callback) { |
| 25 | callback(err, null); |
| 26 | } |
| 27 | }); |
| 28 | } catch (err) { |
| 29 | winston.log('error', { error: String(err), stack: new Error().stack }); |
| 30 | } |
| 31 | }, |
| 32 | |
| 33 | |
| 34 | /* Attaches the socketId to the session of the user. |