aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/redis.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/server/lib/redis.ts b/server/lib/redis.ts
index 97ff3598b..5bd55109c 100644
--- a/server/lib/redis.ts
+++ b/server/lib/redis.ts
@@ -88,6 +88,18 @@ class Redis {
88 }) 88 })
89 } 89 }
90 90
91 generateResetPasswordKey (userId: number) {
92 return 'reset-password-' + userId
93 }
94
95 buildViewKey (ip: string, videoUUID: string) {
96 return videoUUID + '-' + ip
97 }
98
99 buildCachedRouteKey (req: express.Request) {
100 return req.method + '-' + req.originalUrl
101 }
102
91 private getValue (key: string) { 103 private getValue (key: string) {
92 return new Promise<string>((res, rej) => { 104 return new Promise<string>((res, rej) => {
93 this.client.get(this.prefix + key, (err, value) => { 105 this.client.get(this.prefix + key, (err, value) => {
@@ -146,18 +158,6 @@ class Redis {
146 }) 158 })
147 } 159 }
148 160
149 private generateResetPasswordKey (userId: number) {
150 return 'reset-password-' + userId
151 }
152
153 private buildViewKey (ip: string, videoUUID: string) {
154 return videoUUID + '-' + ip
155 }
156
157 private buildCachedRouteKey (req: express.Request) {
158 return req.method + '-' + req.originalUrl
159 }
160
161 static get Instance () { 161 static get Instance () {
162 return this.instance || (this.instance = new this()) 162 return this.instance || (this.instance = new this())
163 } 163 }