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

Function saveSession

helpers/session.js:44–56  ·  view source on GitHub ↗
(session, expireDays, callback)

Source from the content-addressed store, hash-verified

42 * @callback : Its a simple callback.
43 */
44 saveSession(session, expireDays, callback) {
45 try {
46 config.redisClient.set(session.id, JSON.stringify(session), (err, reply) => {
47 // ttl time 30 * 24 * 60 * 60 for 30 days
48 config.redisClient.expire(session.id, expireDays * 24 * 60 * 60);
49 if (callback) {
50 callback(err, reply);
51 }
52 });
53 } catch (err) {
54 winston.log('error', { error: String(err), stack: new Error().stack });
55 }
56 },
57
58};

Callers

nothing calls this directly

Calls 2

callbackFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected