mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
4351702587
commit
01420fd189
2 changed files with 5 additions and 5 deletions
|
|
@ -449,6 +449,7 @@ async def yjs_document_update(sid, data):
|
|||
await stop_item_tasks(REDIS, document_id)
|
||||
|
||||
user_id = data.get("user_id", sid)
|
||||
|
||||
update = data["update"] # List of bytes from frontend
|
||||
|
||||
if document_id not in DOCUMENTS:
|
||||
|
|
@ -484,7 +485,6 @@ async def yjs_document_update(sid, data):
|
|||
document_id, data.get("data", {}), SESSION_POOL.get(sid)
|
||||
)
|
||||
|
||||
await stop_item_tasks(REDIS, document_id) # Cancel previous in-flight save
|
||||
await create_task(REDIS, debounced_save(), document_id)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -289,15 +289,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
onConnect() {
|
||||
onConnect = () => {
|
||||
this.isConnected = true;
|
||||
this.joinDocument();
|
||||
}
|
||||
};
|
||||
|
||||
onDisconnect() {
|
||||
onDisconnect = () => {
|
||||
this.isConnected = false;
|
||||
this.synced = false;
|
||||
}
|
||||
};
|
||||
|
||||
destroy() {
|
||||
this.socket.off('yjs:document:update');
|
||||
|
|
|
|||
Loading…
Reference in a new issue