Browse Source

redis精简

release_0.0.1
yuan_yi 3 years ago
parent
commit
12be6e0ba6
  1. 4
      code/VideoAccess-VCMP/api/app/lib/service/redis.js
  2. 2
      code/VideoAccess-VCMP/web/.vscode/settings.json

4
code/VideoAccess-VCMP/api/app/lib/service/redis.js

@ -1,4 +1,5 @@
'use strict'; 'use strict';
// https://github.com/luin/ioredis
const redis = require("ioredis") const redis = require("ioredis")
const moment = require('moment') const moment = require('moment')
@ -18,8 +19,7 @@ module.exports = async function factory (app, opts) {
// 自定义方法 // 自定义方法
async function hdelall (key) { async function hdelall (key) {
const obj = await client.hgetall(key); const obj = await client.hgetall(key);
const hkeys = Object.keys(obj) await client.hdel(key, Object.keys(obj))
await client.hdel(key, hkeys)
} }
app.redis = client app.redis = client

2
code/VideoAccess-VCMP/web/.vscode/settings.json

@ -1,4 +1,4 @@
// //
{ {
"editor.fontSize": 12, "editor.fontSize": 16,
} }
Loading…
Cancel
Save