Skip to content

Commit

Permalink
Don't throw if initializing more than once, fixes pieceofsummer#120
Browse files Browse the repository at this point in the history
  • Loading branch information
khellang committed Oct 17, 2023
1 parent 5b04073 commit e99c9a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hangfire.Console/GlobalConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public static IGlobalConfiguration UseConsole(this IGlobalConfiguration configur
throw new ArgumentNullException(nameof(configuration));
}

options = options ?? new ConsoleOptions();
options ??= new ConsoleOptions();

options.Validate(nameof(options));

if (DashboardRoutes.Routes.Contains("/console/([0-9a-f]{11}.+)"))
{
throw new InvalidOperationException("Console is already initialized");
return configuration;
}

// register server filter for jobs
Expand Down

0 comments on commit e99c9a2

Please sign in to comment.