Skip to content

Commit

Permalink
Define DOCKER constant
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaKamikaze committed Sep 25, 2024
1 parent 1f37e5e commit 2dc9689
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions MoxfieldPriceScraper/MoxfieldPriceScraper.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Condition="'$(DOCKER_BUILD)' == 'true'">
<DefineConstants>DOCKER</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
Expand Down
10 changes: 4 additions & 6 deletions MoxfieldPriceScraper/MoxfieldScraper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Drawing;
using System.Globalization;
using System.Runtime.InteropServices;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using Serilog;
Expand Down Expand Up @@ -121,12 +120,11 @@ private void InitializeWebDriver()
};
chromeOptions.AddUserProfilePreference("prefs", preferences);

#if DOCKER
// Skip driver setup for ARM architecture
if (!(RuntimeInformation.OSArchitecture == Architecture.Arm &&
RuntimeInformation.OSArchitecture == Architecture.Arm64))
{
new DriverManager().SetUpDriver(new ChromeConfig());
}
#else
new DriverManager().SetUpDriver(new ChromeConfig());
#endif

_driver = new ChromeDriver(chromeOptions);
_driver.Manage().Timeouts().ImplicitWait = _elementSeekTimeout;
Expand Down

0 comments on commit 2dc9689

Please sign in to comment.