Skip to content

Commit

Permalink
Simplify PlaywrightManager.shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkn committed May 30, 2024
1 parent 38b93df commit 023d23c
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions lib/charty/backends/backend_helpers/playwright_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,10 @@ module PlaywrightManager
end

module_function def shutdown
if @_context
@_context.close
@_context = nil
end
if @_browser
@_browser.close
@_browser = nil
end
if @_playwright_exec
@_playwright_exec.stop
@_playwright_exec = nil
end
@_playwright_exec.stop if @_playwright_exec
@_playwright_exec = nil
@_context = nil
@_browser = nil
end

at_exit do
Expand Down

0 comments on commit 023d23c

Please sign in to comment.