HangfireIO / HangfireIO/Hangfire

Async overload to UseSqlServerStorage extension method to provide an async DbConnection factory

Open
#2,138 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

Hi! When registering hangfire and configuring SqlServer storage there are cases when the creation of the DbConnection requires the use of async/await (e. g. connecting to a database using Active Directory Integrated authentication method, requires retrieving an access token prior to the connection).

Currently with the ServiceCollection extension methods there are it's forcing the use of `GetAwaiter().GetResult()` to do it.
Could it be possible to add an overload to SqlServerStorageExtensions.UseSqlServerStorage that receives an argument `connectionFactory` that is of type `Func>`?
Thanks!

Contributor guide

Open the contributing guide

Research direction

Search the repository for SqlServerStorageExtensions.UseSqlServerStorage and inspect the existing overloads and their connection-factory handling. Done means an overload accepts Func> and allows asynchronous connection creation without requiring callers to block with GetAwaiter().GetResult().

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.