(sid: string, sess: SessionData, cb?: Callback)
| 56 | } |
| 57 | |
| 58 | async set(sid: string, sess: SessionData, cb?: Callback) { |
| 59 | let key = this.prefix + sid |
| 60 | let ttl = this.getTTL(sess) |
| 61 | try { |
| 62 | if (ttl > 0) { |
| 63 | let val = this.serializer.stringify(sess) |
| 64 | if (this.disableTTL) await this.client.set(key, val) |
| 65 | else |
| 66 | await this.client.set(key, val, { |
| 67 | expiration: {type: "EX", value: ttl}, |
| 68 | }) |
| 69 | return optionalCb(null, null, cb) |
| 70 | } |
| 71 | return this.destroy(sid, cb) |
| 72 | } catch (err) { |
| 73 | return optionalCb(err, null, cb) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | async touch(sid: string, sess: SessionData, cb?: Callback) { |
| 78 | let key = this.prefix + sid |
no test coverage detected