@xuda.io/xuda-worker-bundle-min 1.3.508 → 1.3.510
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.js +13 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1064,7 +1064,7 @@ func.common.perform_rpi_request = async function (
|
|
|
1064
1064
|
data
|
|
1065
1065
|
) {
|
|
1066
1066
|
const http = async function () {
|
|
1067
|
-
const fetchWithTimeout = (url, options = {}, timeout =
|
|
1067
|
+
const fetchWithTimeout = (url, options = {}, timeout = 600000) => {
|
|
1068
1068
|
// 100 seconds
|
|
1069
1069
|
const controller = new AbortController();
|
|
1070
1070
|
const { signal } = controller;
|
|
@@ -1124,15 +1124,20 @@ func.common.perform_rpi_request = async function (
|
|
|
1124
1124
|
service: serviceP,
|
|
1125
1125
|
data,
|
|
1126
1126
|
});
|
|
1127
|
+
throw new Error("fail to fetch from ws");
|
|
1127
1128
|
};
|
|
1128
1129
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1130
|
+
try {
|
|
1131
|
+
if (
|
|
1132
|
+
RUNTIME_SERVER_WEBSOCKET &&
|
|
1133
|
+
RUNTIME_SERVER_WEBSOCKET_CONNECTED &&
|
|
1134
|
+
SESSION_OBJ?.[SESSION_ID]?.rpi_http_methods?.includes(serviceP)
|
|
1135
|
+
) {
|
|
1136
|
+
return await ws();
|
|
1137
|
+
} else {
|
|
1138
|
+
throw new Error("fail to fetch from ws websocket inactive");
|
|
1139
|
+
}
|
|
1140
|
+
} catch (err) {
|
|
1136
1141
|
return await http();
|
|
1137
1142
|
}
|
|
1138
1143
|
};
|