using Quartz;
using SecureSharing.Business.Interfaces;

namespace SecureSharing.Quartz;

public sealed class MessageDeletionJob : IJob
{
    private readonly IMessageService _messageService;

    public MessageDeletionJob(IMessageService messageService)
    {
        _messageService = messageService;
    }

    public async Task Execute(IJobExecutionContext context)
    {
        try
        {
            await _messageService.DeleteExpiredMessages();
        }
        catch (Exception ex)
        {
            /*Log*/
        }
    }
}