🐛 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)
|
||||
{
|
||||
|
@@ -18,11 +18,9 @@ public class FlushBufferService(ILogger<FlushBufferService> logger)
|
||||
var type = typeof(T);
|
||||
lock (_lockObject)
|
||||
{
|
||||
if (!_buffers.TryGetValue(type, out var buffer))
|
||||
{
|
||||
buffer = new ConcurrentQueue<T>();
|
||||
_buffers[type] = buffer;
|
||||
}
|
||||
if (_buffers.TryGetValue(type, out var buffer)) return (ConcurrentQueue<T>)buffer;
|
||||
buffer = new ConcurrentQueue<T>();
|
||||
_buffers[type] = buffer;
|
||||
return (ConcurrentQueue<T>)buffer;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user