Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
C
ComfyUI
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
锁定的文件
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
hanamizuki
ComfyUI
提交
6253ec4a
提交
6253ec4a
编辑于
1 year ago
作者:
comfyanonymous
浏览文件
操作
下载
补丁
差异文件
Fix server crashing because of terminated websocket connection.
上级
bb1f45d6
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
server.py
+9
-4
9 个添加, 4 个删除
server.py
有
9 个添加
和
4 个删除
server.py
+
9
−
4
浏览文件 @
6253ec4a
...
...
@@ -30,6 +30,11 @@ import comfy.model_management
class
BinaryEventTypes
:
PREVIEW_IMAGE
=
1
async
def
send_socket_catch_exception
(
function
,
message
):
try
:
await
function
(
message
)
except
(
aiohttp
.
ClientError
,
aiohttp
.
ClientPayloadError
,
ConnectionResetError
)
as
err
:
print
(
"
send error:
"
,
err
)
@web.middleware
async
def
cache_control
(
request
:
web
.
Request
,
handler
):
...
...
@@ -487,18 +492,18 @@ class PromptServer():
if
sid
is
None
:
for
ws
in
self
.
sockets
.
values
():
await
ws
.
send_bytes
(
message
)
await
send_socket_catch_exception
(
ws
.
send_bytes
,
message
)
elif
sid
in
self
.
sockets
:
await
self
.
sockets
[
sid
].
send_bytes
(
message
)
await
send_socket_catch_exception
(
self
.
sockets
[
sid
].
send_bytes
,
message
)
async
def
send_json
(
self
,
event
,
data
,
sid
=
None
):
message
=
{
"
type
"
:
event
,
"
data
"
:
data
}
if
sid
is
None
:
for
ws
in
self
.
sockets
.
values
():
await
ws
.
send_json
(
message
)
await
send_socket_catch_exception
(
ws
.
send_json
,
message
)
elif
sid
in
self
.
sockets
:
await
self
.
sockets
[
sid
].
send_json
(
message
)
await
send_socket_catch_exception
(
self
.
sockets
[
sid
].
send_json
,
message
)
def
send_sync
(
self
,
event
,
data
,
sid
=
None
):
self
.
loop
.
call_soon_threadsafe
(
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录