docker files fixes from liaqat
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using Managing.Application.Abstractions;
|
||||
using Managing.Application.ManageBot.Commands;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Managing.Application.ManageBot;
|
||||
|
||||
public class DeleteBotCommandHandler : IRequestHandler<DeleteBotCommand, bool>
|
||||
{
|
||||
private readonly ILogger<DeleteBotCommandHandler> _log;
|
||||
private readonly ITaskCache _taskCache;
|
||||
|
||||
public DeleteBotCommandHandler(ITaskCache taskCache, ILogger<DeleteBotCommandHandler> log)
|
||||
{
|
||||
_taskCache = taskCache;
|
||||
_log = log;
|
||||
}
|
||||
|
||||
public Task<bool> Handle(DeleteBotCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
_taskCache.Invalidate(request.Name);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_log.LogError(e.Message);
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user