Skip to content

Commit

Permalink
fix: avoid page leaking
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Jul 30, 2023
1 parent bdb4f6e commit 434336b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (b *Bartender) RenderPage(w http.ResponseWriter, r *http.Request) bool {
page := b.getPage()
defer b.pool.Put(page)

page, cancel := page.WithCancel()
page, cancel := page.Context(r.Context()).WithCancel()

once := sync.Once{}

Expand All @@ -178,7 +178,7 @@ func (b *Bartender) RenderPage(w http.ResponseWriter, r *http.Request) bool {
})
}()

_ = page.Context(r.Context()).Navigate(u)
_ = page.Navigate(u)

_ = page.WaitStable(time.Second)

Expand Down

0 comments on commit 434336b

Please sign in to comment.