Commit c69053ee by pengjinyang

使用内存执行任务。

parent 85ad8cd5
...@@ -33,11 +33,11 @@ namespace TakeStock.API ...@@ -33,11 +33,11 @@ namespace TakeStock.API
public Startup(IConfiguration configuration) public Startup(IConfiguration configuration)
{ {
Configuration = configuration; Configuration = configuration;
Redis = ConnectionMultiplexer.Connect(Configuration.GetConnectionString("Redis")); //Redis = ConnectionMultiplexer.Connect(Configuration.GetConnectionString("Redis"));
} }
public IConfiguration Configuration { get; } public IConfiguration Configuration { get; }
public static ConnectionMultiplexer Redis; //public static ConnectionMultiplexer Redis;
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
...@@ -74,11 +74,11 @@ namespace TakeStock.API ...@@ -74,11 +74,11 @@ namespace TakeStock.API
services.AddHttpClient(); services.AddHttpClient();
// Add Hangfire services. // Add Hangfire services.
//services.AddHangfire(config => services.AddHangfire(config =>
//{ {
// config.UseMemoryStorage(); config.UseMemoryStorage();
//}); });
services.AddHangfire(configuration => configuration.UseRedisStorage(Redis)); //services.AddHangfire(configuration => configuration.UseRedisStorage(Redis));
// Add the processing server as IHostedService // Add the processing server as IHostedService
services.AddHangfireServer(); services.AddHangfireServer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment