Goit

Simple and lightweight Git web server
Mirror of https://github.com/Jamozed/Goit
git clone http://git.omkov.net/Goit
Log | Tree | Refs | README | Download

AuthorJakob Wakeling <[email protected]>
Date2023-12-18 10:56:42
Commitb43fa87f6b1f433cc0a2f518ef478cde2c7f8520
Parenta9ee9eb8226084d4d0a2db1d597e93ad86fd9074

Fix removing all cron jobs after cron run

Diffstat

M src/cron/cron.go | 3 ++-

1 files changed, 2 insertions, 1 deletions

diff --git a/src/cron/cron.go b/src/cron/cron.go
index e9568f4..3fdf619 100644
--- a/src/cron/cron.go
+++ b/src/cron/cron.go
@@ -82,7 +82,8 @@ func (c *Cron) Start() {
 				tmp := c.jobs[:0]
 				for _, job := range c.jobs {
 					if job.next.After(now) || job.next.IsZero() {
-						break
+						tmp = append(tmp, job)
+						continue
 					}
 
 					log.Println("[cron] running job", job.id, job.rid)