The documentation does not mention the purpose of some options, hence my question on how to properly configure Hangfire from the Startup class and avoid any duplicate code lines.
Have a look at the commented 3 lines, are they necessary?
Imports Hangfire
Imports Hangfire.SqlServer
Imports Microsoft.Owin
Imports Owin
<Assembly: OwinStartup(GetType(dk.Startup))>
Namespace dk
Public Class Startup
Public Sub Configuration(app As IAppBuilder)
Dim options = New BackgroundJobServerOptions() With { _
.Queues = New String() {"mailblastqueue", "verifymailqueue", "emailalertqueue"}, _
.ServerName = "MailBlastServer" _
}
Dim StorageOptions = New SqlServerStorageOptions With {.InvisibilityTimeout = TimeSpan.FromHours(2)}
GlobalConfiguration.Configuration.UseSqlServerStorage("myconnectionstring", StorageOptions)
app.UseHangfireServer(options)
app.UseHangfireDashboard()
'What about the following commented lines? Are they necessary?
'Dim jobStorage__1 = New Hangfire.SqlServer.SqlServerStorage("myconnectionstring")
'JobStorage.Current = jobStorage__1
'app.UseHangfireServer(options, jobStorage__1)
End Sub
End Class
End Namespace