2020-10-20 16:20:38 +03:00
|
|
|
using Hangfire;
|
|
|
|
using Hangfire.MemoryStorage;
|
|
|
|
using MalwareMultiScan.Worker.Jobs;
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
namespace MalwareMultiScan.Worker
|
|
|
|
{
|
|
|
|
public class Startup
|
|
|
|
{
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddLogging();
|
|
|
|
services.AddControllers();
|
2020-10-20 17:08:40 +03:00
|
|
|
services.AddHttpClient();
|
2020-10-20 16:20:38 +03:00
|
|
|
|
|
|
|
services.AddSingleton<ScanJob>();
|
|
|
|
|
|
|
|
services.AddHangfire(
|
|
|
|
configuration => configuration.UseMemoryStorage());
|
|
|
|
|
|
|
|
services.AddHangfireServer();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
|
|
{
|
|
|
|
app.UseRouting();
|
|
|
|
|
2020-10-23 11:11:19 +03:00
|
|
|
app.UseEndpoints(
|
|
|
|
endpoints => endpoints.MapControllers());
|
2020-10-20 16:20:38 +03:00
|
|
|
|
|
|
|
app.UseHangfireServer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|