成绩统计图
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Diagnostics;
|
||||
using Jiaowu.Api.Domain.Academic;
|
||||
using Jiaowu.Api.Domain.System;
|
||||
using Jiaowu.Api.Infrastructure.Exams;
|
||||
using Jiaowu.Api.Infrastructure.Grades;
|
||||
using Jiaowu.Api.Infrastructure.Persistence;
|
||||
using Jiaowu.Api.Infrastructure.Scheduling;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -100,6 +101,11 @@ public sealed class BackgroundJobRunner(
|
||||
.GetRequiredService<ExamPublishJobProcessor>()
|
||||
.ProcessAsync(message.JobId, cancellationToken);
|
||||
break;
|
||||
case BackgroundJobKind.CourseGradeStatisticsRefresh:
|
||||
await scope.ServiceProvider
|
||||
.GetRequiredService<CourseGradeStatisticsRefreshJobProcessor>()
|
||||
.ProcessAsync(message.JobId, cancellationToken);
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException(
|
||||
$"Unsupported background job kind '{message.JobKind}'.");
|
||||
@@ -308,6 +314,19 @@ public sealed class BackgroundJobRunner(
|
||||
.SetProperty(x => x.CompletedAt, completedAt),
|
||||
cancellationToken);
|
||||
break;
|
||||
case BackgroundJobKind.CourseGradeStatisticsRefresh:
|
||||
await db.CourseGradeStatisticsRefreshJobs
|
||||
.Where(x => x.Id == message.JobId &&
|
||||
x.Status != CourseGradeStatisticsRefreshJobStatus.Succeeded &&
|
||||
x.Status != CourseGradeStatisticsRefreshJobStatus.Failed)
|
||||
.ExecuteUpdateAsync(
|
||||
setters => setters
|
||||
.SetProperty(x => x.Status,
|
||||
CourseGradeStatisticsRefreshJobStatus.Failed)
|
||||
.SetProperty(x => x.ErrorMessage, error)
|
||||
.SetProperty(x => x.CompletedAt, completedAt),
|
||||
cancellationToken);
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(
|
||||
nameof(message.JobKind),
|
||||
|
||||
Reference in New Issue
Block a user