@maiyunnet/kebab 7.2.0 → 7.3.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.
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "7.2.0";
8
+ export declare const VER = "7.3.0";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  export declare const LIB_PATH: string;
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '7.2.0';
9
+ export const VER = '7.3.0';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/net.d.ts CHANGED
@@ -140,7 +140,9 @@ export interface IRequestOptions {
140
140
  'auth': string;
141
141
  'data'?: any;
142
142
  };
143
- /** --- 默认为 default --- */
143
+ /** --- 连接是否保持长连接(即是否允许复用),默认为 true --- */
144
+ 'keep'?: boolean;
145
+ /** --- 复用池名,默认为 default --- */
144
146
  'reuse'?: string;
145
147
  /** --- cookie 托管对象 --- */
146
148
  'cookie'?: Record<string, ICookie>;
package/lib/net.js CHANGED
@@ -210,6 +210,7 @@ export async function request(u, data, opt = {}) {
210
210
  'connectionOptions': {
211
211
  'remoteHost': typeof hosts === 'string' ? hosts : hosts[hostname],
212
212
  },
213
+ 'keepAlive': opt.keep,
213
214
  });
214
215
  }
215
216
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
5
5
  "type": "module",
6
6
  "keywords": [
package/sys/master.js CHANGED
@@ -21,6 +21,8 @@ const workerList = {};
21
21
  * --- 最终调用执行的函数块 ---
22
22
  */
23
23
  async function run() {
24
+ // --- 设置 cluster 调度策略为 round-robin(在支持的平台上启用负载均衡) ---
25
+ cluster.default.schedulingPolicy = cluster.default.SCHED_RR;
24
26
  // --- 读取配置文件 ---
25
27
  const configContent = await lFs.getContent(kebab.CONF_CWD + 'config.json', 'utf8');
26
28
  if (!configContent) {