Skip to content

Commit

Permalink
removed code which is not needed anymore in go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Mar 19, 2024
1 parent 6368cf0 commit 5219503
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
22 changes: 6 additions & 16 deletions server/backend/cron/cronjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ const (
CanteenHeadcount = "canteenHeadCount"
MovieType = "movie"
FeedbackEmail = "feedbackEmail"

/* MensaType = "mensa"
AlarmType = "alarm" */
// AlarmType = "alarm"
)

func New(db *gorm.DB) *CronService {
Expand Down Expand Up @@ -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(&copyCronjob) })
g.Go(func() error { return c.newsCron(&cronjob) })

Check failure on line 68 in server/backend/cron/cronjobs.go

View workflow job for this annotation

GitHub Actions / lint

loopclosure: loop variable cronjob captured by func literal (govet)
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:
Expand Down
4 changes: 0 additions & 4 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 5219503

Please sign in to comment.