@zwa73/utils 1.0.180 → 1.0.181

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/dist/UtilCom.js CHANGED
@@ -28,7 +28,7 @@ var UtilCom;
28
28
  //请求超时
29
29
  if (hasTimeLimit) {
30
30
  res.setTimeout(timeLimit, () => {
31
- UtilLogger_1.SLogger.warn(`${flagName} 接收反馈超时(timeLimit): ${timeLimit} ms`);
31
+ UtilLogger_1.SLogger.warn(`${flagName} 接收反馈超时: ${timeLimit} ms`);
32
32
  resolve(undefined);
33
33
  });
34
34
  }
@@ -60,13 +60,13 @@ var UtilCom;
60
60
  //请求超时
61
61
  if (hasTimeLimit) {
62
62
  req.setTimeout(timeLimit, () => {
63
- UtilLogger_1.SLogger.warn(`${flagName} 发送请求超时(timeLimit): ${timeLimit} ms`);
64
- req.destroy();
65
- });
66
- req.on('timeout', () => {
67
- UtilLogger_1.SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
63
+ UtilLogger_1.SLogger.warn(`${flagName} 发送请求超时: ${timeLimit} ms`);
68
64
  req.destroy();
69
65
  });
66
+ //req.on('timeout', ()=>{
67
+ // SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
68
+ // req.destroy();
69
+ //});
70
70
  }
71
71
  req.on('error', (e) => {
72
72
  UtilLogger_1.SLogger.warn(`${flagName} 发送请求错误:${e}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.180",
3
+ "version": "1.0.181",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/UtilCom.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { AnyString, JObject, PRecord, ReqVerifyFn } from "@src/UtilInterfaces";
1
+ import { AnyString, JObject, PRecord, ReqVerifyFn } from "@/src/UtilInterfaces";
2
2
  import https from 'https';
3
3
  import http from 'http';
4
- import { SLogger } from "@src/UtilLogger";
5
- import { RepeatPromiseOpt, RepeatPromiseResult, UtilFunc } from "@src/UtilFunctions";
4
+ import { SLogger } from "@/src/UtilLogger";
5
+ import { RepeatPromiseOpt, RepeatPromiseResult, UtilFunc } from "@/src/UtilFunctions";
6
6
  import qs from "querystring";
7
7
 
8
8
  /**网络请求返回值 */
@@ -78,7 +78,7 @@ export async function comReq<T>(
78
78
  //请求超时
79
79
  if(hasTimeLimit){
80
80
  res.setTimeout(timeLimit!, ()=>{
81
- SLogger.warn(`${flagName} 接收反馈超时(timeLimit): ${timeLimit} ms`);
81
+ SLogger.warn(`${flagName} 接收反馈超时: ${timeLimit} ms`);
82
82
  resolve(undefined);
83
83
  });
84
84
  }
@@ -113,13 +113,13 @@ export async function comReq<T>(
113
113
  //请求超时
114
114
  if(hasTimeLimit){
115
115
  req.setTimeout(timeLimit!, ()=>{
116
- SLogger.warn(`${flagName} 发送请求超时(timeLimit): ${timeLimit} ms`);
117
- req.destroy();
118
- });
119
- req.on('timeout', ()=>{
120
- SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
116
+ SLogger.warn(`${flagName} 发送请求超时: ${timeLimit} ms`);
121
117
  req.destroy();
122
118
  });
119
+ //req.on('timeout', ()=>{
120
+ // SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
121
+ // req.destroy();
122
+ //});
123
123
  }
124
124
 
125
125
  req.on('error', (e)=>{
@@ -2,7 +2,7 @@ import { FfprobeData } from "fluent-ffmpeg";
2
2
  import fluentFfmpeg from "fluent-ffmpeg";
3
3
  import path from "pathe";
4
4
  import * as fs from "fs";
5
- import { SLogger } from "@src/UtilLogger";
5
+ import { SLogger } from "@/src/UtilLogger";
6
6
  import { Stream } from "./UtilClass";
7
7
 
8
8
  /**输入输出路径映射
@@ -1,8 +1,8 @@
1
1
  import * as fs from "fs";
2
2
  import path from 'pathe';
3
3
  import * as os from "os";
4
- import { JObject, JToken } from "@src/UtilInterfaces";
5
- import { SLogger } from "@src/UtilLogger";
4
+ import { JObject, JToken } from "@/src/UtilInterfaces";
5
+ import { SLogger } from "@/src/UtilLogger";
6
6
  import * as JSON5 from 'json5';
7
7
  import { globSync, glob } from "glob";
8
8
  import { UtilFunc } from "./UtilFunctions";
@@ -1,7 +1,7 @@
1
1
  import * as crypto from "crypto";
2
- import { PRecord, AnyFunc, ExtractOutcome, IJData, JObject, JToken, Keyable, Literal, Matchable, MatchableFlag, Outcome, ReqStat, ReqVerifyFn, ProperSubsetCheck, UnionToIntersection, AnyRecord, AllExtends } from "@src/UtilInterfaces";
2
+ import { PRecord, AnyFunc, ExtractOutcome, IJData, JObject, JToken, Keyable, Literal, Matchable, MatchableFlag, Outcome, ReqStat, ReqVerifyFn, ProperSubsetCheck, UnionToIntersection, AnyRecord, AllExtends } from "@/src/UtilInterfaces";
3
3
  import * as cp from "child_process";
4
- import { LogLevel, SLogger } from "@src/UtilLogger";
4
+ import { LogLevel, SLogger } from "@/src/UtilLogger";
5
5
  import { Completed, Failed, FailedLike, None, StatusSymbol, Success, SuccessLike, Terminated, Timeout } from "./UtilSymbol";
6
6
  import { LogTimeAsync } from "./UtilDecorators";
7
7
  import opath from 'path';