Skip to content

Commit

Permalink
remove writeDeadline that vercel doesn't support
Browse files Browse the repository at this point in the history
  • Loading branch information
will-wow committed May 22, 2024
1 parent 35928e8 commit f96d352
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
coverage
.task
.vercel
2 changes: 1 addition & 1 deletion examples/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {
server := &http.Server{
Addr: "localhost:8080",
Handler: handler,
ReadTimeout: time.Second * 10,
ReadTimeout: time.Second * 30,
WriteTimeout: time.Second * 10,
}

Expand Down
7 changes: 0 additions & 7 deletions examples/web/sse_ex/sse_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ func (ex *example) chatroom(w http.ResponseWriter, r *http.Request) {
func (ex *example) feed(w http.ResponseWriter, r *http.Request) {
rc := http.NewResponseController(w)

err := rc.SetWriteDeadline(time.Now().Add(30 * time.Second))
if err != nil {
fmt.Println("failed to set write deadline", err)
return
}

feedTimeout := time.NewTimer(25 * time.Second)

ctx := r.Context()
Expand Down Expand Up @@ -81,7 +75,6 @@ func (ex *example) feed(w http.ResponseWriter, r *http.Request) {
return
case <-ctx.Done():
fmt.Println("ctx done")
// TODO: header
return
case msg := <-room:
fmt.Println("msg", msg.Message)
Expand Down

0 comments on commit f96d352

Please sign in to comment.