befly 3.17.10 → 3.17.11
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/lib/dbHelper/execute.js +12 -4
- package/package.json +2 -2
package/lib/dbHelper/execute.js
CHANGED
|
@@ -19,10 +19,18 @@ export const executeMethods = {
|
|
|
19
19
|
|
|
20
20
|
try {
|
|
21
21
|
let queryResult;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
// Bun 事件循环 bug workaround:
|
|
23
|
+
// 当事件循环中只有一个 I/O 源(SQL socket)时,Bun 会走单源快速路径,
|
|
24
|
+
// 在 I/O 回调内直接唤醒 JS Promise,跳过正常调度,导致 SQL 连接状态
|
|
25
|
+
// 未完全重置,下一条查询的 Promise resolver 永久丢失(远程 TCP 连接必现)。
|
|
26
|
+
// 预注册一个 timer 使事件循环中同时存在两种事件源,强制 Bun 走正常多源调度路径。
|
|
27
|
+
// timer 时长无关紧要,查询完成后会被 clearTimeout 清理。
|
|
28
|
+
const _timer = setTimeout(() => {}, 2147483647);
|
|
29
|
+
const queryPromise = safeParams.length > 0 ? this.sql.unsafe(sql, safeParams) : this.sql.unsafe(sql);
|
|
30
|
+
try {
|
|
31
|
+
queryResult = await queryPromise;
|
|
32
|
+
} finally {
|
|
33
|
+
clearTimeout(_timer);
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
const duration = Date.now() - startTime;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly",
|
|
3
|
-
"version": "3.17.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "3.17.11",
|
|
4
|
+
"gitHead": "d6f49d8da98a65d26d4d4866ff3a3671e178c1fb",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly - 为 Bun 专属打造的 JavaScript API 接口框架核心引擎",
|
|
7
7
|
"keywords": [
|