Skip to content

Commit

Permalink
feat: set the inner cache limit via env (#33)
Browse files Browse the repository at this point in the history
Description
---
Set the cache (the ones that is caching blocks) size limit.

Motivation and Context
---

How Has This Been Tested?
---

What process can a PR reviewer use to test or verify this change?
---

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
leet4tari authored Feb 28, 2024
2 parents c3cfc8f + 0e22528 commit bf65337
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Cache {
constructor(limit = 1000) {
constructor(limit) {
this.limit = limit;
this.cache = new Map();
}
Expand Down Expand Up @@ -27,5 +27,7 @@ class Cache {
}
}

var cache = new Cache();
var cache = new Cache(
+process.env.TARI_EXPLORER_OLD_BLOCKS_CACHE_SETTINGS || 1000
);
module.exports = cache;

0 comments on commit bf65337

Please sign in to comment.