예제 #1
0
        public async Task JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException, CancellationToken cancellationToken = default(CancellationToken))
        {
            var entry = await _store.Get(context.FireInstanceId);

            if (entry != null)
            {
                entry.FinishedTimeUtc  = DateTime.UtcNow;
                entry.ExceptionMessage = jobException?.GetBaseException()?.Message;
                await _store.Save(entry);
            }
            if (jobException == null)
            {
                await _store.IncrementTotalJobsExecuted();
            }
            else
            {
                await _store.IncrementTotalJobsFailed();
            }
        }
예제 #2
0
        public async Task JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException, CancellationToken cancellationToken = default)
        {
            var entry = await _store.Get(context.FireInstanceId);

            if (entry != null)
            {
                entry.FinishedTime = DateTime.Now;
                var exception = jobException?.GetBaseException();
                if (exception != null)
                {
                    entry.ExceptionMessage = exception.Message;
                    entry.ExceptionDetail  = exception.ToString();
                }
                await _store.Save(entry);
            }
            if (jobException == null)
            {
                await _store.IncrementTotalJobsExecuted();
            }
            else
            {
                await _store.IncrementTotalJobsFailed();
            }
        }