2 Commits
Author SHA1 Message Date
Rogee 4bc900f387 feat: support cronjob initers 2025-03-15 21:17:12 +08:00
rogeecn e7a1db2c16 fix: job contracts 2025-03-11 09:44:44 +08:00
+14 -7
View File
@@ -1,15 +1,22 @@
package contracts
import (
"time"
"github.com/riverqueue/river"
)
type CronJob interface {
Description() string
Periodic() time.Duration
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
}