trm-client 7.4.1 → 7.4.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.txt CHANGED
@@ -8,6 +8,10 @@ Legend
8
8
  + : added
9
9
  - : removed
10
10
 
11
+ 2026-03-04 v7.4.2
12
+ -------------------
13
+ * fix cache expiry
14
+
11
15
  2026-03-03 v7.4.1
12
16
  -------------------
13
17
  ! trm-core ^8.4.1
@@ -173,12 +173,14 @@ class GlobalContext {
173
173
  }
174
174
  setGlobalNpmPathInternal() {
175
175
  const globalNpmPathCache = this._cache.globalNpmPath;
176
- if (!globalNpmPathCache || (globalNpmPathCache.ts && Date.now() - globalNpmPathCache.ts > this.getSettings().npmGlobalPathCheckCache * 1000)) {
177
- trm_commons_1.Logger.loading(`Cache expired, setting npm global modules path...`, true);
178
- const path = (0, trm_commons_1.getGlobalNodeModules)();
179
- trm_commons_1.Logger.log(`Npm global modules path set to ${path}`, true);
180
- this.setCache('globalNpmPath', path);
176
+ const isValid = !!globalNpmPathCache && !!globalNpmPathCache.ts && (Date.now() - globalNpmPathCache.ts) < this.getSettings().npmGlobalPathCheckCache * 1000;
177
+ if (isValid) {
178
+ return globalNpmPathCache.data;
181
179
  }
180
+ trm_commons_1.Logger.loading(`Cache expired, setting npm global modules path...`, true);
181
+ const path = (0, trm_commons_1.getGlobalNodeModules)();
182
+ trm_commons_1.Logger.log(`Npm global modules path set to ${path}`, true);
183
+ this.setCache('globalNpmPath', path);
182
184
  }
183
185
  getSettingsInternal() {
184
186
  const defaultSettings = this.getDefaultSettings();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-client",
3
- "version": "7.4.1",
3
+ "version": "7.4.2",
4
4
  "description": "TRM (Transport Request Manager) Client",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",