Path: redb/redb.Templates/templates/route-xml/redb-route-cron/routes/CleanupJobRoute.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/route-xml/redb-route-cron/routes/CleanupJobRoute.cs ---- using redb.Route.Core; namespace RouteModule.Routes; /// /// A sibling of routes/schedules.route.xml in C#: a cleanup job on a cron schedule of its own, on the same Quartz /// scheduler and in the same time zone. The job works out in C# which day it cleans up. /// public sealed class CleanupJobRoute : RouteBuilder { protected override void Configure() { // At second 15 of every minute by default; a real cleanup would be "0 30 2 * * ?", at half past two at night. // The time zone, stateful and misfireInstruction as in the XML report job. From("cron://cs-modulectx-cleanup?schedule={{cleanup.schedule:15 * * * * ?}}&timeZone={{report.timeZone:UTC}}&stateful=true&misfireInstruction=CronDoNothing") .RouteId("cs-modulectx-cleanup") .Description("Runs the cleanup job on a cron schedule") .Process(exchange => { // The day whose leftovers the job removes: everything older than yesterday, in UTC. var cutoff = DateOnly.FromDateTime(DateTime.UtcNow).AddDays(-1); exchange.In.Body = cutoff.ToString("yyyy-MM-dd"); }) .Log("cleanup job: removing what is older than ${body}"); } }