@pioneer-platform/pioneer-cache 1.17.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/stores/transaction-cache.js +12 -4
- package/package.json +1 -1
- package/src/stores/transaction-cache.ts +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pioneer-platform/pioneer-cache
|
|
2
2
|
|
|
3
|
+
## 1.17.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- chore: fix(utxo): calculate change index from used addresses only, not derived addresses
|
|
8
|
+
|
|
9
|
+
## 1.17.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fix(utxo): calculate change index from used addresses only, not derived addresses
|
|
14
|
+
|
|
3
15
|
## 1.17.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -100,10 +100,18 @@ class TransactionCache {
|
|
|
100
100
|
try {
|
|
101
101
|
const keys = await this.redis.keys(`${this.keyPrefix}*`);
|
|
102
102
|
const totalKeys = keys.length;
|
|
103
|
-
// Get Redis memory info
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
// Get Redis memory info (if available)
|
|
104
|
+
let memoryUsage = 'unknown';
|
|
105
|
+
if (typeof this.redis.info === 'function') {
|
|
106
|
+
try {
|
|
107
|
+
const info = await this.redis.info('memory');
|
|
108
|
+
const memoryMatch = info.match(/used_memory_human:(.+)/);
|
|
109
|
+
memoryUsage = memoryMatch ? memoryMatch[1].trim() : 'unknown';
|
|
110
|
+
}
|
|
111
|
+
catch (infoError) {
|
|
112
|
+
log.warn(tag, 'Redis info command not available:', infoError);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
107
115
|
log.info(tag, `Cache stats: ${totalKeys} keys, ${memoryUsage} memory`);
|
|
108
116
|
return {
|
|
109
117
|
totalKeys,
|
package/package.json
CHANGED
|
@@ -119,10 +119,17 @@ export class TransactionCache {
|
|
|
119
119
|
const keys = await this.redis.keys(`${this.keyPrefix}*`);
|
|
120
120
|
const totalKeys = keys.length;
|
|
121
121
|
|
|
122
|
-
// Get Redis memory info
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
// Get Redis memory info (if available)
|
|
123
|
+
let memoryUsage = 'unknown';
|
|
124
|
+
if (typeof this.redis.info === 'function') {
|
|
125
|
+
try {
|
|
126
|
+
const info = await this.redis.info('memory');
|
|
127
|
+
const memoryMatch = info.match(/used_memory_human:(.+)/);
|
|
128
|
+
memoryUsage = memoryMatch ? memoryMatch[1].trim() : 'unknown';
|
|
129
|
+
} catch (infoError) {
|
|
130
|
+
log.warn(tag, 'Redis info command not available:', infoError);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
126
133
|
|
|
127
134
|
log.info(tag, `Cache stats: ${totalKeys} keys, ${memoryUsage} memory`);
|
|
128
135
|
|