fix: expire env maps, closes #1906

This commit is contained in:
Guillaume Chau
2018-08-23 00:12:22 +02:00
parent a115151027
commit 8dd0b11747
2 changed files with 10 additions and 2 deletions
+9 -2
View File
@@ -1,11 +1,18 @@
const { execSync } = require('child_process')
const fs = require('fs')
const path = require('path')
const LRU = require('lru-cache')
let _hasYarn
const _yarnProjects = new Map()
const _yarnProjects = new LRU({
max: 10,
maxAge: 1000
})
let _hasGit
const _gitProjects = new Map()
const _gitProjects = new LRU({
max: 10,
maxAge: 1000
})
// env detection
exports.hasYarn = () => {
@@ -23,6 +23,7 @@
"execa": "^0.10.0",
"joi": "^13.0.0",
"launch-editor": "^2.2.1",
"lru-cache": "^4.1.3",
"node-ipc": "^9.1.1",
"opn": "^5.3.0",
"ora": "^2.1.0",