Commit a75e6e3f by pengjinyang

no message

parent f6b3f0c7
......@@ -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,10 +74,11 @@ namespace TakeStock.API
services.AddHttpClient();
// Add Hangfire services.
services.AddHangfire(config =>
{
config.UseMemoryStorage();
});
//services.AddHangfire(config =>
//{
// config.UseMemoryStorage();
//});
services.AddHangfire(configuration => configuration.UseRedisStorage(Redis));
// Add the processing server as IHostedService
services.AddHangfireServer();
......@@ -106,7 +107,7 @@ namespace TakeStock.API
app.UseHangfireDashboard("/hangfire", options);
var options2 = new BackgroundJobServerOptions
{
WorkerCount = Environment.ProcessorCount * 5,
WorkerCount = Environment.ProcessorCount * 10,
Queues = new[] { "freezestock", "rollbackstock", "syncandenabledstock", "checkcomplete", "modifandenabledstock", "canceltakestock", "default" }
};
app.UseHangfireServer(options2);
......
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