mirror of https://github.com/status-im/metro.git
Make Cache dir configurable
Reviewed By: davidaurelio Differential Revision: D2811278 fb-gh-sync-id: 77c03a8f806135fff56914bac60c156d10b05ea4
This commit is contained in:
parent
c2dcb04d29
commit
c75610febb
|
@ -13,7 +13,7 @@ const fs = require('fs');
|
|||
const getCacheFilePath = require('./lib/getCacheFilePath');
|
||||
const isAbsolutePath = require('absolute-path');
|
||||
const loadCacheSync = require('./lib/loadCacheSync');
|
||||
const tmpdir = require('os').tmpDir();
|
||||
const tmpDir = require('os').tmpDir();
|
||||
|
||||
function getObjectValues(object) {
|
||||
return Object.keys(object).map(key => object[key]);
|
||||
|
@ -31,8 +31,9 @@ class Cache {
|
|||
constructor({
|
||||
resetCache,
|
||||
cacheKey,
|
||||
cacheDirectory = tmpDir,
|
||||
}) {
|
||||
this._cacheFilePath = getCacheFilePath(tmpdir, cacheKey);
|
||||
this._cacheFilePath = getCacheFilePath(cacheDirectory, cacheKey);
|
||||
if (!resetCache) {
|
||||
this._data = this._loadCacheSync(this._cacheFilePath);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue