// Hook: BeforeProcessing // Block the job from running on Saturday or Sunday. // // Useful for finance jobs that should only run on business days. The check // happens before any work begins, so a weekend run is rejected cheaply. // You can extend the condition to include public holidays from a list. var today = DateTime.Today; if (today.DayOfWeek == DayOfWeek.Saturday || today.DayOfWeek == DayOfWeek.Sunday) { AddError($"Job '{JobName}' is configured to run on business days only. Today is {today:dddd, MMMM d, yyyy}. Please reschedule."); } Logger.LogInformation($"Business day check passed - proceeding with job '{JobName}'.");