node-automator 1.2.0 → 1.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-automator",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Execute automation with yaml configuration(compatible with json)",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -39,13 +39,14 @@ async function doRequest(data) {
39
39
  let quiet = data.quiet;
40
40
  !quiet && info(useCache ? "[缓存]" : `[${options.method}] ${url} `);
41
41
  let hasProgress = false;
42
+ let fileDst = get_full_path(data.dst || shareData.AUTOMATOR_SCRATCH + "/request_tool/" + cache_name, "FILE");
42
43
  if (useCache) {
43
44
  result = http_cache;
45
+ fs.writeFileSync(fileDst, http_cache);
44
46
  } else {
45
47
  let chunks = [];
46
48
  result = await new Promise(resolve => {
47
49
  let sizeTotal = 0;
48
- let fileDst = get_full_path(data.dst || shareData.AUTOMATOR_SCRATCH + "/request_tool/" + cache_name, "FILE");
49
50
  let cacheDir = path.dirname(cache_path);
50
51
  if (!fs.existsSync(cacheDir)) {
51
52
  fs.mkdirSync(cacheDir, {