mirror of
https://github.com/bitwarden/server.git
synced 2025-05-25 13:24:50 -05:00
alive endpoint and logging
This commit is contained in:
parent
180c3510a4
commit
928e1b6ad4
@ -35,6 +35,7 @@ namespace Bit.EventsProcessor
|
|||||||
|
|
||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
_logger.LogWarning("Starting service.");
|
||||||
_cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
|
_cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
|
||||||
_executingTask = ExecuteAsync(_cts.Token);
|
_executingTask = ExecuteAsync(_cts.Token);
|
||||||
return _executingTask.IsCompleted ? _executingTask : Task.CompletedTask;
|
return _executingTask.IsCompleted ? _executingTask : Task.CompletedTask;
|
||||||
|
@ -3,6 +3,7 @@ using Bit.Core;
|
|||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.IdentityModel.Logging;
|
using Microsoft.IdentityModel.Logging;
|
||||||
@ -41,6 +42,12 @@ namespace Bit.EventsProcessor
|
|||||||
{
|
{
|
||||||
IdentityModelEventSource.ShowPII = true;
|
IdentityModelEventSource.ShowPII = true;
|
||||||
app.UseSerilog(env, appLifetime, globalSettings);
|
app.UseSerilog(env, appLifetime, globalSettings);
|
||||||
|
app.Map("/alive", HandleMapAlive);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void HandleMapAlive(IApplicationBuilder app)
|
||||||
|
{
|
||||||
|
app.Run(async context => await context.Response.WriteAsync(System.DateTime.UtcNow.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user