diff options
author | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-18 19:53:34 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-18 19:53:34 +0000 |
commit | 531112dac0bee796316bc058d74bdbb060b968e5 (patch) | |
tree | da27977556794cb4076266a4da35a540a906ba5f /Main | |
parent | 3260a181a1d5b282e8fbab20fb511cddf30a3b5e (diff) | |
download | newsaggregator-531112dac0bee796316bc058d74bdbb060b968e5.tar.gz newsaggregator-531112dac0bee796316bc058d74bdbb060b968e5.tar.bz2 newsaggregator-531112dac0bee796316bc058d74bdbb060b968e5.zip |
Using temporary in memory storage solution for Hangfire - will move to something like MongoDB
Diffstat (limited to 'Main')
-rw-r--r-- | Main/Main.csproj | 2 | ||||
-rw-r--r-- | Main/Startup.cs | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Main/Main.csproj b/Main/Main.csproj index d0acd53..50d274a 100644 --- a/Main/Main.csproj +++ b/Main/Main.csproj @@ -6,7 +6,7 @@ <ItemGroup>
<PackageReference Include="Hangfire" Version="1.6.22" />
- <PackageReference Include="Hangfire.MySqlStorage" Version="2.0.0" />
+ <PackageReference Include="Hangfire.MemoryStorage" Version="1.6.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.4" />
diff --git a/Main/Startup.cs b/Main/Startup.cs index 7f615fd..c1e4a10 100644 --- a/Main/Startup.cs +++ b/Main/Startup.cs @@ -9,6 +9,8 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
+using Hangfire;
+using Hangfire.MemoryStorage;
using Classes;
using Database;
@@ -29,8 +31,10 @@ namespace Server { });
services.AddDbContext<DatabaseContext>(options => {
- options.UseMySQL(Configuration.GetConnectionString("connectionString"));
+ options.UseMySQL(Configuration.GetConnectionString("Aggregator"));
});
+
+ services.AddHangfire(options => options.UseMemoryStorage());
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env) {
@@ -49,6 +53,9 @@ namespace Server { "Website"
)
);
+
+ app.UseHangfireDashboard();
+ app.UseHangfireServer();
}
}
}
|