Skip to content

Commit

Permalink
Changing .close to console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
Oxyjun committed Jan 14, 2025
1 parent 5941a14 commit 12452f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class WebSocketServer extends DurableObject {
// If the client closes the connection, the runtime will close the connection too.
server.addEventListener("close", (cls) => {
this.currentlyConnectedWebSockets -= 1;
server.close(cls.code, "Durable Object is closing WebSocket");
console.log(cls.code, "Durable Object is closing WebSocket");
});

return new Response(null, {
Expand Down Expand Up @@ -204,7 +204,7 @@ export class WebSocketServer extends DurableObject {
// If the client closes the connection, the runtime will close the connection too.
server.addEventListener("close", (cls: CloseEvent) => {
this.currentlyConnectedWebSockets -= 1;
server.close(cls.code, "Durable Object is closing WebSocket");
console.log(cls.code, "Durable Object is closing WebSocket");
});

return new Response(null, {
Expand Down Expand Up @@ -295,7 +295,7 @@ export class WebSocketHibernationServer extends DurableObject {

async webSocketClose(ws, code, reason, wasClean) {
// If the client closes the connection, the runtime will invoke the webSocketClose() handler.
ws.close(code, "Durable Object is closing WebSocket");
console.log(code, "Durable Object is closing WebSocket");
}
}
```
Expand Down Expand Up @@ -348,7 +348,7 @@ export class WebSocketHibernationServer extends DurableObject {
wasClean: boolean,
) {
// If the client closes the connection, the runtime will invoke the webSocketClose() handler.
ws.close(code, "Durable Object is closing WebSocket");
console.log(code, "Durable Object is closing WebSocket");
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class WebSocketServer extends DurableObject {
// If the client closes the connection, the runtime will close the connection too.
server.addEventListener('close', (cls) => {
this.currentlyConnectedWebSockets -= 1;
server.close(cls.code, "Durable Object is closing WebSocket");
console.log(cls.code, "Durable Object is closing WebSocket");
});

return new Response(null, {
Expand Down Expand Up @@ -174,7 +174,7 @@ export class WebSocketServer extends DurableObject {
// If the client closes the connection, the runtime will close the connection too.
server.addEventListener('close', (cls: CloseEvent) => {
this.currentlyConnectedWebSockets -= 1;
server.close(cls.code, "Durable Object is closing WebSocket");
console.log(cls.code, "Durable Object is closing WebSocket");
});

return new Response(null, {
Expand Down

0 comments on commit 12452f0

Please sign in to comment.