1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

move premium renewal job to hosted job service

This commit is contained in:
Kyle Spearrin
2018-08-10 11:20:04 -04:00
parent aa647c37d3
commit 5f79af2e18
4 changed files with 72 additions and 22 deletions

View File

@ -58,6 +58,10 @@ namespace Bit.Billing
config.Filters.Add(new LoggingExceptionHandlerFilterAttribute());
});
services.Configure<RouteOptions>(options => options.LowercaseUrls = true);
// Jobs service
Jobs.JobsHostedService.AddJobsServices(services);
services.AddHostedService<Jobs.JobsHostedService>();
}
public void Configure(
@ -67,7 +71,17 @@ namespace Bit.Billing
GlobalSettings globalSettings,
ILoggerFactory loggerFactory)
{
loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) => e.Level >= LogEventLevel.Error);
loggerFactory.AddSerilog(app, env, appLifetime, globalSettings, (e) =>
{
var context = e.Properties["SourceContext"].ToString();
if(e.Level == LogEventLevel.Information &&
(context.StartsWith("\"Bit.Billing.Jobs") || context.StartsWith("\"Bit.Core.Jobs")))
{
return true;
}
return e.Level >= LogEventLevel.Error;
});
if(env.IsDevelopment())
{