From 4bc900f387ee74fa23ecad17f56c8b7d2fe89136 Mon Sep 17 00:00:00 2001 From: Rogee Date: Sat, 15 Mar 2025 21:17:12 +0800 Subject: [PATCH] feat: support cronjob initers --- contracts/cron_job.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/contracts/cron_job.go b/contracts/cron_job.go index b17ef0e..4c39022 100644 --- a/contracts/cron_job.go +++ b/contracts/cron_job.go @@ -5,9 +5,18 @@ import ( ) type CronJob interface { - Kind() string - Periodic() river.PeriodicSchedule - JobArgs() river.JobArgs - InsertOpts() river.InsertOpts - RunOnStart() bool + Args() []CronJobArg +} + +type CronJobArgInterface interface { + river.JobArgs + river.JobArgsWithInsertOpts +} + +type CronJobArg struct { + Kind string + RunOnStart bool + PeriodicInterval river.PeriodicSchedule + + Arg CronJobArgInterface }