Skip to content

Commit

Permalink
fix: typo and use ENV.fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
wout committed Feb 24, 2024
1 parent 8da20e1 commit ef5193f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lucky_flow/selenium/chrome/driver.cr
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ end

LuckyFlow::Registry.register :headless_chrome do
LuckyFlow::Selenium::Chrome::Driver.new do |config|
remote_debuggin_port = ENV["CHROME_REMOTE_DEBUGGING_PORT"]? || 9222
remote_debugging_port = ENV.fetch("CHROME_REMOTE_DEBUGGING_PORT", "9222")
config.chrome_options.args = [
"no-sandbox",
"headless",
"disable-gpu",
"remote-debugging-port=#{remote_debuggin_port}",
"remote-debugging-port=#{remote_debugging_port}",
]
end
end
4 changes: 2 additions & 2 deletions src/lucky_flow/selenium/firefox/driver.cr
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ end

LuckyFlow::Registry.register :headless_firefox do
LuckyFlow::Selenium::Firefox::Driver.new do |config|
remote_debuggin_port = ENV["FIREFOX_REMOTE_DEBUGGING_PORT"]? || 9222
remote_debugging_port = ENV.fetch("FIREFOX_REMOTE_DEBUGGING_PORT", "9222")
config.firefox_options.args = [
"--headless",
"--disable-gpu",
"--disable-software-rasterizer",
"--no-sandbox",
"--disable-dev-shm-usage",
"--start-debugger-server=#{remote_debuggin_port}",
"--start-debugger-server=#{remote_debugging_port}",
]
end
end

0 comments on commit ef5193f

Please sign in to comment.