diff --git a/server/backend/cron/cronjobs.go b/server/backend/cron/cronjobs.go index 5f054d02..652ee2ac 100644 --- a/server/backend/cron/cronjobs.go +++ b/server/backend/cron/cronjobs.go @@ -27,9 +27,7 @@ const ( CanteenHeadcount = "canteenHeadCount" MovieType = "movie" FeedbackEmail = "feedbackEmail" - - /* MensaType = "mensa" - AlarmType = "alarm" */ + // AlarmType = "alarm" ) func New(db *gorm.DB) *CronService { @@ -67,25 +65,17 @@ func (c *CronService) Run() error { // Run each job in a separate goroutine, so we can parallelize them switch cronjob.Type.String { case NewsType: - // if this is not copied here, this may not be threads save due to go's guarantees - // loop variable cronjob captured by func literal (govet) - copyCronjob := cronjob - g.Go(func() error { return c.newsCron(©Cronjob) }) + g.Go(func() error { return c.newsCron(&cronjob) }) case FileDownloadType: g.Go(func() error { return c.fileDownloadCron() }) case DishNameDownload: g.Go(func() error { return c.dishNameDownloadCron() }) case MovieType: g.Go(func() error { return c.movieCron() }) - /* - TODO: Implement handlers for other cronjobs - case MensaType: - g.Go(func() error { return c.mensaCron() }) - case KinoType: - g.Go(func() error { return c.kinoCron() }) - case AlarmType: - g.Go(func() error { return c.alarmCron() }) - */ + /* TODO: Implement handlers for other cronjobs + case AlarmType: + g.Go(func() error { return c.alarmCron() }) + */ case CanteenHeadcount: g.Go(func() error { return c.canteenHeadCountCron() }) case FeedbackEmail: diff --git a/server/go.sum b/server/go.sum index c67c0a99..1838833b 100644 --- a/server/go.sum +++ b/server/go.sum @@ -464,12 +464,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c h1:kaI7oewGK5YnVwj+Y+EJBO/YN1ht8iTL9XkFHtVZLsc= -google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c/go.mod h1:VQW3tUculP/D4B+xVCo+VgSq8As6wA9ZjHl//pmk+6s= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2 h1:9IZDv+/GcI6u+a4jRFRLxQs0RUCfavGfoOgEW6jpkI0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI= google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=