core: fix server response handling to prevent connection timeouts
This commit is contained in:
parent
9c5f94bd66
commit
d5a506d4ae
1 changed files with 6 additions and 0 deletions
|
|
@ -125,6 +125,12 @@ export namespace Server {
|
||||||
async (c) => {
|
async (c) => {
|
||||||
log.info("global event connected")
|
log.info("global event connected")
|
||||||
return streamSSE(c, async (stream) => {
|
return streamSSE(c, async (stream) => {
|
||||||
|
stream.writeSSE({
|
||||||
|
data: JSON.stringify({
|
||||||
|
type: "server.connected",
|
||||||
|
properties: {},
|
||||||
|
}),
|
||||||
|
})
|
||||||
async function handler(event: any) {
|
async function handler(event: any) {
|
||||||
await stream.writeSSE({
|
await stream.writeSSE({
|
||||||
data: JSON.stringify(event),
|
data: JSON.stringify(event),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue