zarro 1.188.0 โ†’ 1.190.0

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.
@@ -36,7 +36,7 @@
36
36
  * @param ttlSeconds
37
37
  */
38
38
  write(key, value, ttlSeconds) {
39
- this._store[key] = new CacheItem(value, Date.now() + ttlSeconds);
39
+ this._store[key] = new CacheItem(value, Date.now() + ttlSeconds * 1000);
40
40
  }
41
41
  /**
42
42
  * Runs the generator if there is no cache item with
@@ -21,6 +21,12 @@
21
21
  const Version = requireModule("version");
22
22
  const SystemError = requireModule("system-error");
23
23
  const cache = requireModule("cache");
24
+ const cacheTTLEnvVar = "NUGET_HTTP_CACHE_TTL";
25
+ env.register({
26
+ name: cacheTTLEnvVar,
27
+ default: "300",
28
+ help: "The amount of time, in seconds, to cache nuget query results for (whilst the app is running)"
29
+ });
24
30
  const emojiLabels = {
25
31
  testing: `๐Ÿงช Testing`,
26
32
  packing: `๐Ÿ“ฆ Packing`,
@@ -819,8 +825,7 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
819
825
  if (opts.skipCache) {
820
826
  return await searchPackagesUncached(opts);
821
827
  }
822
- return await cache.through(JSON.stringify(opts), async () => await searchPackagesUncached(opts), 60 // cache for a minute
823
- );
828
+ return await cache.through(JSON.stringify(opts), async () => await searchPackagesUncached(opts), env.resolveNumber(cacheTTLEnvVar));
824
829
  }
825
830
  async function searchPackagesUncached(opts) {
826
831
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.188.0",
3
+ "version": "1.190.0",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "index.js"