0
ajayak created
I switched to Hangfire for BackgroundJob. On enqueuing a background job, I get this error
Async void methods are not supported. Use async Task instead.
Here is the code:
public override async void Execute(long userId)
{
await DeleteWebhooks(userId);
}
It works fine with default BackgroundJob manager
1 Answer(s)
-
0
Related issue: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2366
Meanwhile, run it synchronously with AsyncHelper:
public override void Execute(long userId) { AsyncHelper.RunSync(() => DeleteWebhooks(userId)); }