Skip to content

Commit a587fbb

Browse files
author
Joel Mitchell
committed
Fixed bug with the async activation
1 parent a9cf0d0 commit a587fbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Cofoundry.Plugins.BackgroundTasks.Hangfire/Framework/ContainerJobActivator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ public override object ActivateJob(Type type)
3030

3131
// Bit of a hack here to wrap injectable tasks because
3232
// hangire doesn't support child contexts.
33-
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(InjectableTaskWrapper<>))
33+
if (type.IsGenericType
34+
&& (type.GetGenericTypeDefinition() == typeof(InjectableTaskWrapper<>)
35+
|| type.GetGenericTypeDefinition() == typeof(InjectableAsyncTaskWrapper<>))
36+
)
3437
{
3538
job = Activator.CreateInstance(type, _resolutionContext);
3639
}

0 commit comments

Comments
 (0)