From 3497bc83f130843683f64cd84f2088f2ea8bb4c2 Mon Sep 17 00:00:00 2001 From: ychung-mot Date: Fri, 31 May 2024 12:06:04 -0700 Subject: [PATCH 1/2] chore: resource sizing --- helm/main/values-prod.yaml | 4 ++-- helm/main/values-uat.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/main/values-prod.yaml b/helm/main/values-prod.yaml index 21b818dd..65d53308 100644 --- a/helm/main/values-prod.yaml +++ b/helm/main/values-prod.yaml @@ -94,10 +94,10 @@ hangfire: resources: limits: - cpu: 300m + cpu: 400m memory: 600Mi requests: - cpu: 150m + cpu: 200m memory: 400Mi env: diff --git a/helm/main/values-uat.yaml b/helm/main/values-uat.yaml index a6d35686..353d5869 100644 --- a/helm/main/values-uat.yaml +++ b/helm/main/values-uat.yaml @@ -94,10 +94,10 @@ hangfire: resources: limits: - cpu: 300m + cpu: 400m memory: 600Mi requests: - cpu: 150m + cpu: 200m memory: 400Mi env: From b7044c594c8348428d2e4cacdc43f62a591fa18d Mon Sep 17 00:00:00 2001 From: ychung-mot Date: Fri, 31 May 2024 12:52:05 -0700 Subject: [PATCH 2/2] chore: deleting stalled job --- server/StrDss.Service/Hangfire/SkipSameJobAttribute.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/StrDss.Service/Hangfire/SkipSameJobAttribute.cs b/server/StrDss.Service/Hangfire/SkipSameJobAttribute.cs index bac68d82..d8eb3688 100644 --- a/server/StrDss.Service/Hangfire/SkipSameJobAttribute.cs +++ b/server/StrDss.Service/Hangfire/SkipSameJobAttribute.cs @@ -24,12 +24,13 @@ public void OnCreating(CreatingContext context) //delete stalled jobs var monitor = context.Storage.GetMonitoringApi(); var allJobs = monitor.ProcessingJobs(0, 999999999); - var cutoffTime = DateTime.UtcNow.AddMinutes(-10); + var cutoffTime = DateTime.UtcNow.AddHours(-12); foreach (var processingJob in allJobs) { if (processingJob.Value.StartedAt < cutoffTime) { + Console.WriteLine($"[Hangfire] Deleting stalled job: {processingJob.Key} {processingJob.Value.InProcessingState} "); BackgroundJob.Delete(processingJob.Key); } }