q-koa 13.6.2 → 13.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/app.js CHANGED
@@ -9,7 +9,7 @@ const redis = require('redis')
9
9
  const moment = require('moment')
10
10
  const { EventEmitter } = require('events')
11
11
  const nodeVm = require('vm')
12
- const LRU = require('lru-cache')
12
+ const { LRUCache } = require('lru-cache')
13
13
  const axios = require('axios')
14
14
 
15
15
  const { Serve } = require('static-koa-router')
@@ -560,9 +560,9 @@ class APP {
560
560
  maxAge: 1000 * 60 * 60 * 24,
561
561
  })
562
562
 
563
- this.app[appName].cache = new LRU({
563
+ this.app[appName].cache = new LRUCache({
564
564
  max: cacheConfig.max,
565
- maxAge: cacheConfig.maxAge,
565
+ ttl: cacheConfig.maxAge,
566
566
  })
567
567
 
568
568
  await this.initModel(appName)
@@ -7,10 +7,10 @@ const getCodeUrl =
7
7
  'https://open.douyin.com/platform/oauth/connect?client_key=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s'
8
8
 
9
9
  const Douyin = getService('douyin')
10
- const LRU = require('lru-cache')
11
- const cache = new LRU({
10
+ const { LRUCache } = require('lru-cache')
11
+ const cache = new LRUCache({
12
12
  max: 100,
13
- maxAge: 1000 * 60 * 60,
13
+ ttl: 1000 * 60 * 60,
14
14
  })
15
15
 
16
16
  /**
@@ -4,10 +4,10 @@ const fsPromise = require('fs/promises')
4
4
  const { VM } = require('vm2')
5
5
  const axios = require('axios')
6
6
  const { lodash, getAppByCtx, getConfig, Sequelize, moment } = require('q-koa')
7
- const LRU = require('lru-cache')
8
- const cache = new LRU({
7
+ const { LRUCache } = require('lru-cache')
8
+ const cache = new LRUCache({
9
9
  max: 10,
10
- maxAge: 1000 * 60 * 60,
10
+ ttl: 1000 * 60 * 60,
11
11
  })
12
12
 
13
13
  const isSameArray = (_arr1 = [], _arr2 = [], deep = true) => {
@@ -13,10 +13,10 @@ const hotVideoUrl =
13
13
  const starHostListUrl =
14
14
  'https://open.douyin.com/star/hot_list/?access_token=%s&hot_list_type=%s'
15
15
 
16
- const LRU = require('lru-cache')
17
- const cache = new LRU({
16
+ const { LRUCache } = require('lru-cache')
17
+ const cache = new LRUCache({
18
18
  max: 100,
19
- maxAge: 1000 * 60 * 60,
19
+ ttl: 1000 * 60 * 60,
20
20
  })
21
21
 
22
22
  module.exports = class Singleton {
@@ -7,10 +7,10 @@ const getAccessTokenUrl =
7
7
  const createQRCodeUrl = 'https://developer.toutiao.com/api/apps/qrcode'
8
8
 
9
9
  const fs = require('fs')
10
- const LRU = require('lru-cache')
11
- const cache = new LRU({
10
+ const { LRUCache } = require('lru-cache')
11
+ const cache = new LRUCache({
12
12
  max: 100,
13
- maxAge: 1000 * 60 * 60,
13
+ ttl: 1000 * 60 * 60,
14
14
  })
15
15
  const uuid = require('node-uuid')
16
16
 
@@ -4,10 +4,10 @@ const getAccessTokenUrl = `https://api.weixin.qq.com/cgi-bin/token?grant_type=%s
4
4
  const getTicketUrl =
5
5
  'https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi'
6
6
  const sha1 = require('sha1')
7
- const LRU = require('lru-cache')
8
- const cache = new LRU({
7
+ const { LRUCache } = require('lru-cache')
8
+ const cache = new LRUCache({
9
9
  max: 100,
10
- maxAge: 1000 * 60 * 60,
10
+ ttl: 1000 * 60 * 60,
11
11
  })
12
12
  const { lodash } = require('q-koa')
13
13
 
@@ -104,11 +104,11 @@ const b2bFinishUrl =
104
104
  'https://api.weixin.qq.com/retail/B2b/finishprofitsharingorder?access_token=%s&pay_sig=%s'
105
105
 
106
106
  const fsPromise = require('fs/promises')
107
- const LRU = require('lru-cache')
107
+ const { LRUCache } = require('lru-cache')
108
108
  const request = require('request')
109
- const cache = new LRU({
109
+ const cache = new LRUCache({
110
110
  max: 100,
111
- maxAge: 1000 * 60 * 60,
111
+ ttl: 1000 * 60 * 60,
112
112
  })
113
113
  const uuid = require('node-uuid')
114
114
  const hmacSha256 = (data, secret) => {
@@ -31,10 +31,10 @@ const sendMessageUrl =
31
31
  const getTemplateUrl =
32
32
  'https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=%s'
33
33
 
34
- const LRU = require('lru-cache')
35
- const cache = new LRU({
34
+ const { LRUCache } = require('lru-cache')
35
+ const cache = new LRUCache({
36
36
  max: 100,
37
- maxAge: 1000 * 60 * 60,
37
+ ttl: 1000 * 60 * 60,
38
38
  })
39
39
 
40
40
  module.exports = class Singleton {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "13.6.2",
3
+ "version": "13.6.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -44,7 +44,7 @@
44
44
  "koa-xml-body": "^2.1.0",
45
45
  "koa-proxies": "^0.12.2",
46
46
  "lodash": "^4.17.15",
47
- "lru-cache": "^5.1.1",
47
+ "lru-cache": "^11.5.2",
48
48
  "mockjs": "^1.0.1-beta3",
49
49
  "moment": "^2.24.0",
50
50
  "mysql2": "^1.7.0",