1
0
mirror of https://github.com/Eugeny/tabby.git synced 2025-07-19 18:07:58 +00:00
Files
.github
app
assets
lib
app.ts
cli.ts
config.ts
index.ts
lru.ts
portable.ts
sentry.ts
window.ts
src
dev-app-update.yml
index.pug
package.json
tsconfig.json
tsconfig.main.json
webpack.config.js
webpack.main.config.js
yarn.lock
build
docs
extras
scripts
snap
terminus-community-color-schemes
terminus-core
terminus-plugin-manager
terminus-serial
terminus-settings
terminus-ssh
terminus-terminal
terminus-uac
.all-contributorsrc
.eslintrc.yml
.gitignore
.mergify.yml
.pug-lintrc.js
.travis.yml
CODE_OF_CONDUCT.md
HACKING.md
LICENSE
README.md
appveyor.yml
electron-builder.yml
package.json
tsconfig.json
typedoc.js
webpack.config.js
yarn.lock
tabby/app/lib/lru.ts
Eugene Pankov 2470f5f941 LRU fix
2020-02-05 15:22:28 +03:00

18 lines
450 B
TypeScript

import * as createLRU from 'lru-cache'
import * as fs from 'fs'
const lru = createLRU({ max: 256, maxAge: 250 })
const origLstat = fs.realpathSync.bind(fs)
// NB: The biggest offender of thrashing realpathSync is the node module system
// itself, which we can't get into via any sane means.
require('fs').realpathSync = function (p) {
let r = lru.get(p)
if (r) {
return r
}
r = origLstat(p)
lru.set(p, r)
return r
}