kb-server 0.0.1-beta.42 → 0.0.1-beta.44
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.
|
@@ -93,11 +93,11 @@ const packSSE = (sseHandlers, options) => {
|
|
|
93
93
|
};
|
|
94
94
|
// 推送消息
|
|
95
95
|
const push = (data) => {
|
|
96
|
-
resetTimeout();
|
|
97
96
|
if (!isConnected) {
|
|
98
97
|
logger_1.logger.warning(`连接已关闭: ${requestId}`);
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
100
|
+
resetTimeout();
|
|
101
101
|
const msg = createResponseMsg(data);
|
|
102
102
|
const response = (0, exports.createSSEMsg)("message", msg);
|
|
103
103
|
try {
|
|
@@ -113,6 +113,8 @@ const packSSE = (sseHandlers, options) => {
|
|
|
113
113
|
};
|
|
114
114
|
// 主动关闭
|
|
115
115
|
const close = () => {
|
|
116
|
+
if (!isConnected)
|
|
117
|
+
return;
|
|
116
118
|
logger_1.logger.info(`主动关闭连接: ${requestId}`);
|
|
117
119
|
// 完成响应
|
|
118
120
|
took = Date.now() - start;
|