Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
feat: only enable cache under dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Feb 7, 2019
1 parent 09b44a1 commit 98cc5d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/yuque.js
Expand Up @@ -8,6 +8,7 @@ const debug = require('debug')(`${PACKAGE_NAME}:yuque`)

const AUTH_TOKEN = process.env.YUQUE_QUTH_TOKEN
const SKIP_CACHE = process.env.SKIP_CACHE
const isProduction = process.env.NODE_ENV === 'production'

let instance
let repoId
Expand All @@ -31,7 +32,7 @@ module.exports = class Yuque {
const cacheKey = `fetch.${key}`
let yuque

if (repoId && useCache && !SKIP_CACHE) {
if (!isProduction && repoId && useCache && !SKIP_CACHE) {
yuque = Yuque.getInstance()
const cached = yuque.store.get(cacheKey)
if (cached) {
Expand Down

0 comments on commit 98cc5d1

Please sign in to comment.