コード例 #1
0
        public async Task Execute(IJobExecutionContext context)
        {
            _logger.LogInformation("InvitationsDeletingJob is running.");
            var now = DateTime.UtcNow;

            try
            {
                var deleted = await _invitationService.RemoveOldInvitationsAsync(now);

                _logger.LogInformation($"Old invitations deleted: {deleted}. Time: {now}");
            }
            catch (Exception ex)
            {
                _logger.LogError($"Unable to delete old invitations: {ex.Message}.");
            }
        }