From a561915df932c729cfd9c37cf22cedaed455ed44 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 14 Apr 2017 23:07:05 +0100 Subject: [PATCH] Added Hangfire #865 --- Ombi/Ombi.Core/Ombi.Core.csproj | 1 + Ombi/Ombi.Schedule/Class1.cs | 8 ++++++++ Ombi/Ombi.Schedule/Ombi.Schedule.csproj | 13 +++++++++++++ Ombi/Ombi.sln | 6 ++++++ Ombi/Ombi/Ombi.csproj | 2 ++ Ombi/Ombi/Startup.cs | 20 ++++++++++++++++---- 6 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 Ombi/Ombi.Schedule/Class1.cs create mode 100644 Ombi/Ombi.Schedule/Ombi.Schedule.csproj diff --git a/Ombi/Ombi.Core/Ombi.Core.csproj b/Ombi/Ombi.Core/Ombi.Core.csproj index e2b8d857f..706bf55a4 100644 --- a/Ombi/Ombi.Core/Ombi.Core.csproj +++ b/Ombi/Ombi.Core/Ombi.Core.csproj @@ -8,6 +8,7 @@ + diff --git a/Ombi/Ombi.Schedule/Class1.cs b/Ombi/Ombi.Schedule/Class1.cs new file mode 100644 index 000000000..9f1c9aa3b --- /dev/null +++ b/Ombi/Ombi.Schedule/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace Ombi.Schedule +{ + public class Class1 + { + } +} diff --git a/Ombi/Ombi.Schedule/Ombi.Schedule.csproj b/Ombi/Ombi.Schedule/Ombi.Schedule.csproj new file mode 100644 index 000000000..5fa73ec90 --- /dev/null +++ b/Ombi/Ombi.Schedule/Ombi.Schedule.csproj @@ -0,0 +1,13 @@ + + + + netstandard1.6 + + + + + + + + + \ No newline at end of file diff --git a/Ombi/Ombi.sln b/Ombi/Ombi.sln index ac1f55b44..15d1bee35 100644 --- a/Ombi/Ombi.sln +++ b/Ombi/Ombi.sln @@ -34,6 +34,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DI", "DI", "{410F36CF-9C60- EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Api.Plex", "Ombi.Api.Plex\Ombi.Api.Plex.csproj", "{2E1A7B91-F29B-42BC-8F1E-1CF2DCC389BA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Schedule", "Ombi.Schedule\Ombi.Schedule.csproj", "{5B42ADD4-757A-47C1-9CC5-320829C5E665}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -76,6 +78,10 @@ Global {2E1A7B91-F29B-42BC-8F1E-1CF2DCC389BA}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E1A7B91-F29B-42BC-8F1E-1CF2DCC389BA}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E1A7B91-F29B-42BC-8F1E-1CF2DCC389BA}.Release|Any CPU.Build.0 = Release|Any CPU + {5B42ADD4-757A-47C1-9CC5-320829C5E665}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B42ADD4-757A-47C1-9CC5-320829C5E665}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B42ADD4-757A-47C1-9CC5-320829C5E665}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B42ADD4-757A-47C1-9CC5-320829C5E665}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Ombi/Ombi/Ombi.csproj b/Ombi/Ombi/Ombi.csproj index 10eacc179..49d424003 100644 --- a/Ombi/Ombi/Ombi.csproj +++ b/Ombi/Ombi/Ombi.csproj @@ -84,6 +84,8 @@ + + diff --git a/Ombi/Ombi/Startup.cs b/Ombi/Ombi/Startup.cs index 9c153ba7a..822a5ab8e 100644 --- a/Ombi/Ombi/Startup.cs +++ b/Ombi/Ombi/Startup.cs @@ -1,4 +1,6 @@ using AutoMapper; +using Hangfire; +using Hangfire.MemoryStorage; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.StaticFiles; @@ -12,6 +14,16 @@ namespace Ombi { public partial class Startup { + + //public void ConfigureServices(IServiceCollection services) + //{ + //} + + //public void Configure(IApplicationBuilder app) + //{ + // app.UseHangfireServer(); + // app.UseHangfireDashboard(); + //} public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() @@ -33,6 +45,8 @@ namespace Ombi services.AddOmbiMappingProfile(); services.AddAutoMapper(); services.RegisterDependencies(); // Ioc and EF + + services.AddHangfire(x => x.UseMemoryStorage(new MemoryStorageOptions())); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -50,7 +64,8 @@ namespace Ombi app.UseExceptionHandler("/Home/Error"); } - + app.UseHangfireServer(); + app.UseHangfireDashboard(); ConfigureAuth(app); @@ -73,8 +88,5 @@ namespace Ombi defaults: new { controller = "Home", action = "Index" }); }); } - - - } }