I'm attempting to set up Hangfire in an existing Umbraco 7.4 site. I have my configuration class set up as so:
[assembly: OwinStartup(typeof(HangfireStartup))]
namespace Jobs
{
public class HangfireStartup
{
public void Configuration(IAppBuilder app)
{
GlobalConfiguration.Configuration.UseSqlServerStorage("hangfireDb");
app.UseHangfireDashboard("");
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AuthorizationFilters = new[] { new HangfireAuthorisationFilter() },
AppPath = "/umbraco/"
});
app.UseHangfireServer();
}
}
}
But this method is never called. The only way I can get my Configuration method to execute is if I remove the appSetting "owin:appStartup" which obviously borks Umbraco.
using System;
using Owin;
using Umbraco.Web;
namespace Umbraco741Hangfire
{
public class OwinStartup : UmbracoDefaultOwinStartup
{
public override void Configuration(IAppBuilder app)
{
base.Configuration(app);
Console.WriteLine("Setting up Hangfire...");
}
}
}
Hangfire.io with Umbraco 7.4.0
I'm attempting to set up Hangfire in an existing Umbraco 7.4 site. I have my configuration class set up as so:
But this method is never called. The only way I can get my Configuration method to execute is if I remove the appSetting "owin:appStartup" which obviously borks Umbraco.
What am I missing here?
You should be able to subclass UmbracoDefaultOwinStartup and call
before adding your own Hangfire code?
Cheers, Dirk
Hmm, nope, still nothing. If you want to give this a shot I have a base Umbraco 7.4.1 install with Hangfire here:
https://github.com/gfyans/UmbracoHangfire
Here's my test class from that project:
Ahaha never mind, I forgot to update the appSetting to my new class:
That is it now working. Thanks!
Glad I could be of (little) help.
--Dirk
is working on a reply...