mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-12 05:06:37 +08:00
send sync not redis
This commit is contained in:
parent
89ee8735e0
commit
da7b4fd11a
24
server.py
24
server.py
@ -655,18 +655,18 @@ class PromptServer():
|
|||||||
await send_socket_catch_exception(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):
|
def send_sync(self, event, data, sid=None):
|
||||||
if hasattr(self, "last_prompt_id") is not True:
|
# if hasattr(self, "last_prompt_id") is not True:
|
||||||
logging.warning("server has not attr last_prompt_id")
|
# logging.warning("server has not attr last_prompt_id")
|
||||||
return
|
# return
|
||||||
prompt_id = self.last_prompt_id
|
# prompt_id = self.last_prompt_id
|
||||||
key = "comfy_response_" + prompt_id
|
# key = "comfy_response_" + prompt_id
|
||||||
message = {
|
# message = {
|
||||||
"type": event,
|
# "type": event,
|
||||||
"data": data,
|
# "data": data,
|
||||||
}
|
# }
|
||||||
res = self.redis_op.zadd_with_expire(key, json.dumps(message), int(time.time()), 120)
|
# res = self.redis_op.zadd_with_expire(key, json.dumps(message), int(time.time()), 120)
|
||||||
if not res:
|
# if not res:
|
||||||
logging.warning(f"Failed to send {event}")
|
# logging.warning(f"Failed to send {event}")
|
||||||
self.loop.call_soon_threadsafe(
|
self.loop.call_soon_threadsafe(
|
||||||
self.messages.put_nowait, (event, data, sid))
|
self.messages.put_nowait, (event, data, sid))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user