mirror of
https://github.com/bitwarden/server
synced 2026-01-03 17:14:00 +00:00
connection counter
This commit is contained in:
28
src/Notifications/Jobs/LogConnectionCounterJob.cs
Normal file
28
src/Notifications/Jobs/LogConnectionCounterJob.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Jobs;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Notifications.Jobs
|
||||
{
|
||||
public class LogConnectionCounterJob : BaseJob
|
||||
{
|
||||
private readonly ConnectionCounter _connectionCounter;
|
||||
|
||||
public LogConnectionCounterJob(
|
||||
ILogger<LogConnectionCounterJob> logger,
|
||||
ConnectionCounter connectionCounter)
|
||||
: base(logger)
|
||||
{
|
||||
_connectionCounter = connectionCounter;
|
||||
}
|
||||
|
||||
protected override Task ExecuteJobAsync(IJobExecutionContext context)
|
||||
{
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId,
|
||||
"Connection count: {0}", _connectionCounter.GetCount());
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user