docker files fixes from liaqat

This commit is contained in:
alirehmani
2024-05-03 16:39:25 +05:00
commit 464a8730e8
587 changed files with 44288 additions and 0 deletions

View File

@@ -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);
}
}
}