mirror of
https://github.com/bitwarden/server.git
synced 2025-07-11 12:53:50 -05:00
move event processor to aspnet hosted service
This commit is contained in:
@ -1,40 +1,17 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Bit.EventsProcessor
|
||||
{
|
||||
class Program
|
||||
public class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = new HostBuilder();
|
||||
builder.ConfigureWebJobs(b =>
|
||||
{
|
||||
b.AddAzureStorageCoreServices();
|
||||
b.AddAzureStorage(a =>
|
||||
{
|
||||
a.BatchSize = 5;
|
||||
});
|
||||
// Not working. ref: https://github.com/Azure/azure-webjobs-sdk/issues/1962
|
||||
b.AddDashboardLogging();
|
||||
});
|
||||
builder.ConfigureLogging((context, b) =>
|
||||
{
|
||||
b.AddConsole();
|
||||
b.SetMinimumLevel(LogLevel.Warning);
|
||||
});
|
||||
builder.ConfigureHostConfiguration(b =>
|
||||
{
|
||||
b.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
|
||||
b.AddEnvironmentVariables();
|
||||
});
|
||||
var host = builder.Build();
|
||||
using(host)
|
||||
{
|
||||
host.Run();
|
||||
}
|
||||
WebHost
|
||||
.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>()
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user