@zwa73/utils 1.0.181 → 1.0.182

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} ms`);
31
+ UtilLogger_1.SLogger.warn(`${flagName} 接收反馈超时(timeLimit): ${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} ms`);
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`);
64
68
  req.destroy();
65
69
  });
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.181",
3
+ "version": "1.0.182",
4
4
  "description": "my utils",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/UtilCom.ts CHANGED
@@ -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} ms`);
81
+ SLogger.warn(`${flagName} 接收反馈超时(timeLimit): ${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} ms`);
116
+ SLogger.warn(`${flagName} 发送请求超时(timeLimit): ${timeLimit} ms`);
117
+ req.destroy();
118
+ });
119
+ req.on('timeout', ()=>{
120
+ SLogger.warn(`${flagName} 发送请求超时(timeout): ${timeLimit} ms`);
117
121
  req.destroy();
118
122
  });
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)=>{