Skip to content
Permalink
Browse files

feat: only enable cache under dev mode

  • Loading branch information...
ulivz committed Feb 7, 2019
1 parent 09b44a1 commit 98cc5d1028fc8739d115fee9ca4c19b88a4308f4
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/yuque.js
@@ -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
@@ -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) {

0 comments on commit 98cc5d1

Please sign in to comment.
You can’t perform that action at this time.