We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8a27f9 commit f683721Copy full SHA for f683721
src/config/redis.ts
@@ -10,12 +10,18 @@ client.on('error', function (err) {
10
console.log(`Something went wrong ${err}`)
11
})
12
13
-export function redisCache(key: string, data: any[]): void {
14
- client.setex(key, 86400, JSON.stringify(data))
15
-}
+class Redis {
+ public static set(key: string, data: any[]) {
+ client.setex(key, 86400, JSON.stringify(data))
16
+ }
17
+
18
+ public static get(key: string) {
19
+ client.get(key)
20
21
-export function redisDeleteCache(key: string) {
- client.del(key)
22
+ public static del(key: string) {
23
+ client.del(key)
24
25
}
26
-export default client
27
+export default Redis
0 commit comments