MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / getSession

Function getSession

helpers/socketSession.js:19–31  ·  view source on GitHub ↗
(socketId, callback)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

callbackFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected