🐛 Fix last active info didn't flushed
This commit is contained in:
@@ -53,7 +53,7 @@ public class LastActiveFlushHandler(IServiceProvider srp, ILogger<LastActiveFlus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LastActiveFlushJob(FlushBufferService fbs, ActionLogFlushHandler hdl, ILogger<LastActiveFlushJob> logger) : IJob
|
public class LastActiveFlushJob(FlushBufferService fbs, LastActiveFlushHandler hdl, ILogger<LastActiveFlushJob> logger) : IJob
|
||||||
{
|
{
|
||||||
public async Task Execute(IJobExecutionContext context)
|
public async Task Execute(IJobExecutionContext context)
|
||||||
{
|
{
|
||||||
|
@@ -18,11 +18,9 @@ public class FlushBufferService(ILogger<FlushBufferService> logger)
|
|||||||
var type = typeof(T);
|
var type = typeof(T);
|
||||||
lock (_lockObject)
|
lock (_lockObject)
|
||||||
{
|
{
|
||||||
if (!_buffers.TryGetValue(type, out var buffer))
|
if (_buffers.TryGetValue(type, out var buffer)) return (ConcurrentQueue<T>)buffer;
|
||||||
{
|
buffer = new ConcurrentQueue<T>();
|
||||||
buffer = new ConcurrentQueue<T>();
|
_buffers[type] = buffer;
|
||||||
_buffers[type] = buffer;
|
|
||||||
}
|
|
||||||
return (ConcurrentQueue<T>)buffer;
|
return (ConcurrentQueue<T>)buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user