From d8a3900545828ce147cd985a9aef865887b46ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B8=CC=86=20=D0=9A?= =?UTF-8?q?=D1=83=D1=80=D0=BE=D0=BF=D0=B0=D1=82=D0=BA=D0=B8=D0=BD?= Date: Wed, 9 Oct 2024 10:01:12 +0200 Subject: [PATCH 1/2] v3: Added the WithEntries function to option.go to handle cases where the app is restarted and has pre-existing running cron jobs. --- .gitignore | 2 ++ go.mod | 2 +- option.go | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 00268614..9d2a6639 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ _cgo_export.* _testmain.go *.exe + +.idea diff --git a/go.mod b/go.mod index 8c95bf47..cc47cd27 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/robfig/cron/v3 +module github.com/NickTaporuk/cron/v3 go 1.12 diff --git a/option.go b/option.go index 07638201..3b49e486 100644 --- a/option.go +++ b/option.go @@ -43,3 +43,10 @@ func WithLogger(logger Logger) Option { c.logger = logger } } + +// WithEntries uses the provided entries. +func WithEntries(entries []*Entry) Option { + return func(c *Cron) { + c.entries = entries + } +} From 73fed431d78ad0ea510d06ff2830b74c679a01fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B8=CC=86=20=D0=9A?= =?UTF-8?q?=D1=83=D1=80=D0=BE=D0=BF=D0=B0=D1=82=D0=BA=D0=B8=D0=BD?= Date: Thu, 17 Oct 2024 10:58:24 +0200 Subject: [PATCH 2/2] v3: file go.mod package naming was updated to previous one --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cc47cd27..8c95bf47 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/NickTaporuk/cron/v3 +module github.com/robfig/cron/v3 go 1.12