diff --git a/src/BUTR.Site.NexusMods.Server/Jobs/AutocompleteProcessorProcessorJob.cs b/src/BUTR.Site.NexusMods.Server/Jobs/AutocompleteProcessorProcessorJob.cs index a103dfbd..0ee4d52b 100644 --- a/src/BUTR.Site.NexusMods.Server/Jobs/AutocompleteProcessorProcessorJob.cs +++ b/src/BUTR.Site.NexusMods.Server/Jobs/AutocompleteProcessorProcessorJob.cs @@ -62,7 +62,9 @@ public AutocompleteProcessorProcessorJob(ILogger public async Task Execute(IJobExecutionContext context) { - var ct = context.CancellationToken; + using var ctsTimeout = new CancellationTokenSource(TimeSpan.FromMinutes(10)); + using var cts = CancellationTokenSource.CreateLinkedTokenSource(context.CancellationToken, ctsTimeout.Token); + var ct = cts.Token; foreach (var tenant in TenantId.Values) { diff --git a/src/BUTR.Site.NexusMods.Server/Jobs/CrashReportProcessorJob.cs b/src/BUTR.Site.NexusMods.Server/Jobs/CrashReportProcessorJob.cs index a33bde15..c026f572 100644 --- a/src/BUTR.Site.NexusMods.Server/Jobs/CrashReportProcessorJob.cs +++ b/src/BUTR.Site.NexusMods.Server/Jobs/CrashReportProcessorJob.cs @@ -10,6 +10,7 @@ using System; using System.Linq; +using System.Threading; using System.Threading.Tasks; namespace BUTR.Site.NexusMods.Server.Jobs; @@ -28,7 +29,9 @@ public CrashReportProcessorJob(ILogger logger, IService public async Task Execute(IJobExecutionContext context) { - var ct = context.CancellationToken; + using var ctsTimeout = new CancellationTokenSource(TimeSpan.FromMinutes(10)); + using var cts = CancellationTokenSource.CreateLinkedTokenSource(context.CancellationToken, ctsTimeout.Token); + var ct = cts.Token; var processed = 0; foreach (var tenant in TenantId.Values) diff --git a/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleProcessorJob.cs b/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleProcessorJob.cs index 8380ebe6..bdf17531 100644 --- a/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleProcessorJob.cs +++ b/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleProcessorJob.cs @@ -31,7 +31,9 @@ public NexusModsArticleProcessorJob(ILogger logger public async Task Execute(IJobExecutionContext context) { - var ct = context.CancellationToken; + using var ctsTimeout = new CancellationTokenSource(TimeSpan.FromMinutes(30)); + using var cts = CancellationTokenSource.CreateLinkedTokenSource(context.CancellationToken, ctsTimeout.Token); + var ct = cts.Token; foreach (var tenant in TenantId.Values) { diff --git a/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleUpdatesProcessorJob.cs b/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleUpdatesProcessorJob.cs index 79f602ee..580c7526 100644 --- a/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleUpdatesProcessorJob.cs +++ b/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsArticleUpdatesProcessorJob.cs @@ -31,7 +31,9 @@ public NexusModsArticleUpdatesProcessorJob(ILogger logger public async Task Execute(IJobExecutionContext context) { - var ct = context.CancellationToken; + using var ctsTimeout = new CancellationTokenSource(TimeSpan.FromDays(1)); + using var cts = CancellationTokenSource.CreateLinkedTokenSource(context.CancellationToken, ctsTimeout.Token); + var ct = cts.Token; var processed = 0; var exceptions = new List(); diff --git a/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsModFileUpdatesProcessorJob.cs b/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsModFileUpdatesProcessorJob.cs index 36c99210..1caf2c9d 100644 --- a/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsModFileUpdatesProcessorJob.cs +++ b/src/BUTR.Site.NexusMods.Server/Jobs/NexusModsModFileUpdatesProcessorJob.cs @@ -38,7 +38,9 @@ public NexusModsModFileUpdatesProcessorJob(ILogger(); diff --git a/src/BUTR.Site.NexusMods.Server/Jobs/TopExceptionsTypesAnalyzerProcessorJob.cs b/src/BUTR.Site.NexusMods.Server/Jobs/TopExceptionsTypesAnalyzerProcessorJob.cs index fb31a832..b408f675 100644 --- a/src/BUTR.Site.NexusMods.Server/Jobs/TopExceptionsTypesAnalyzerProcessorJob.cs +++ b/src/BUTR.Site.NexusMods.Server/Jobs/TopExceptionsTypesAnalyzerProcessorJob.cs @@ -30,7 +30,9 @@ public TopExceptionsTypesAnalyzerProcessorJob(ILogger