Commit c69053ee by pengjinyang

使用内存执行任务。

parent 85ad8cd5
......@@ -33,11 +33,11 @@ namespace TakeStock.API
public Startup(IConfiguration configuration)
{
Configuration = configuration;
Redis = ConnectionMultiplexer.Connect(Configuration.GetConnectionString("Redis"));
//Redis = ConnectionMultiplexer.Connect(Configuration.GetConnectionString("Redis"));
}
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.
public void ConfigureServices(IServiceCollection services)
......@@ -74,11 +74,11 @@ namespace TakeStock.API
services.AddHttpClient();
// Add Hangfire services.
//services.AddHangfire(config =>
//{
// config.UseMemoryStorage();
//});
services.AddHangfire(configuration => configuration.UseRedisStorage(Redis));
services.AddHangfire(config =>
{
config.UseMemoryStorage();
});
//services.AddHangfire(configuration => configuration.UseRedisStorage(Redis));
// Add the processing server as IHostedService
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