diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 8e8d14fac..bff1c5cf7 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -23,6 +23,8 @@ jobs: node-version: 18 cache: 'yarn' - run: yarn install + - run: yarn install + working-directory: ./docs - run: npm run format - name: Commit files run: | diff --git a/lib/middleware/cache/memory.js b/lib/middleware/cache/memory.js index 671ac3cf1..21dc9c7d4 100644 --- a/lib/middleware/cache/memory.js +++ b/lib/middleware/cache/memory.js @@ -1,9 +1,9 @@ -const Lru = require('lru-cache'); +const { LRUCache } = require('lru-cache'); const config = require('@/config').value; const status = { available: false }; -const memoryCache = new Lru({ +const memoryCache = new LRUCache({ ttl: config.cache.routeExpire * 1000, max: config.memory.max, }); diff --git a/package.json b/package.json index 56239a31e..ddadb1325 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "koa-basic-auth": "4.0.0", "koa-favicon": "2.1.0", "koa-mount": "4.0.0", - "lru-cache": "8.0.5", + "lru-cache": "9.1.1", "lz-string": "1.5.0", "mailparser": "3.6.4", "markdown-it": "13.0.1", diff --git a/yarn.lock b/yarn.lock index 2b50535bb..46e3420ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4830,10 +4830,10 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== -lru-cache@8.0.5: - version "8.0.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-8.0.5.tgz#983fe337f3e176667f8e567cfcce7cb064ea214e" - integrity sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA== +lru-cache@9.1.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1" + integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A== lru-cache@^4.0.1: version "4.1.5"