From 6a60bc016cc650141ad7316e464430f02e028a83 Mon Sep 17 00:00:00 2001 From: James Gunn Date: Thu, 2 Jan 2025 11:58:43 +0000 Subject: [PATCH] Register ITT & QTS audit sync jobs --- .../Jobs/HostApplicationBuilderExtensions.cs | 10 ++++++++++ .../Jobs/SyncAllDqtContactAuditsJob.cs | 2 ++ .../Jobs/SyncAllDqtIttAuditsJob.cs | 2 ++ .../Jobs/SyncAllDqtQtsAuditsJob.cs | 2 ++ 4 files changed, 16 insertions(+) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/HostApplicationBuilderExtensions.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/HostApplicationBuilderExtensions.cs index 2758e99e7..34176fa4f 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/HostApplicationBuilderExtensions.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/HostApplicationBuilderExtensions.cs @@ -199,6 +199,16 @@ public static IHostApplicationBuilder AddBackgroundJobs(this IHostApplicationBui job => job.ExecuteAsync(CancellationToken.None), Cron.Never); + recurringJobManager.AddOrUpdate( + nameof(SyncAllDqtIttAuditsJob), + job => job.ExecuteAsync(CancellationToken.None), + Cron.Never); + + recurringJobManager.AddOrUpdate( + nameof(SyncAllDqtQtsAuditsJob), + job => job.ExecuteAsync(CancellationToken.None), + Cron.Never); + return Task.CompletedTask; }); } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtContactAuditsJob.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtContactAuditsJob.cs index 0df8e3210..47f11d343 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtContactAuditsJob.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtContactAuditsJob.cs @@ -73,5 +73,7 @@ await trsDataSyncHelper.SyncAuditAsync( break; } } + + logger.LogWarning("Synced {Count} contact audit records.", fetched); } } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtIttAuditsJob.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtIttAuditsJob.cs index 9a82778b0..03d20f972 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtIttAuditsJob.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtIttAuditsJob.cs @@ -73,5 +73,7 @@ await trsDataSyncHelper.SyncAuditAsync( break; } } + + logger.LogWarning("Synced {Count} dfeta_initialteachertraining audit records.", fetched); } } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtQtsAuditsJob.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtQtsAuditsJob.cs index 60052f1a5..b8daf3591 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtQtsAuditsJob.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Core/Jobs/SyncAllDqtQtsAuditsJob.cs @@ -73,5 +73,7 @@ await trsDataSyncHelper.SyncAuditAsync( break; } } + + logger.LogWarning("Synced {Count} dfeta_qtsregistration audit records.", fetched); } }