init dir
This commit is contained in:
parent
1a2a715d59
commit
6c458686a7
1 changed files with 4 additions and 1 deletions
|
|
@ -17,6 +17,9 @@ export default class {
|
|||
this.settings = settings;
|
||||
this.metricsPath = [settings.dataDir, "metric_events"].join("/")
|
||||
this.cachePath = [settings.dataDir, "metric_cache"].join("/")
|
||||
if (!fs.existsSync(this.cachePath)) {
|
||||
fs.mkdirSync(this.cachePath, { recursive: true });
|
||||
}
|
||||
this.initMetricsMeta()
|
||||
this.loadCache()
|
||||
setInterval(() => {
|
||||
|
|
@ -78,7 +81,7 @@ export default class {
|
|||
|
||||
persistCache = () => {
|
||||
const last24CachePath = [this.cachePath, "last24hSF.json"].join("/")
|
||||
fs.writeFileSync(last24CachePath, JSON.stringify(this.last24hCache))
|
||||
fs.writeFileSync(last24CachePath, JSON.stringify(this.last24hCache), {})
|
||||
}
|
||||
|
||||
loadCache = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue