Skip to content

Commit

Permalink
Merge branch 'main' into endpoint_listMeals
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Mar 11, 2024
2 parents ec9b2bc + a0e877b commit 1a2a16b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 59 deletions.
27 changes: 0 additions & 27 deletions .github/dependabot.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ spec:
env:
- name: ENVIRONMENT
value: prod
- name: MensaCronDisabled
value: "true"
- name: APNS_P8_FILE_PATH
value: /etc/apns_auth_key.p8
- name: OMDB_API_KEY
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
- APNS_KEY_ID=${APNS_KEY_ID}
- APNS_TEAM_ID=${APNS_TEAM_ID}
- APNS_P8_FILE_PATH=${APNS_P8_FILE_PATH}
- MensaCronDisabled=true
- OMDB_API_KEY=${OMDB_API_KEY}
- CAMPUS_API_TOKEN=${CAMPUS_API_TOKEN}
- SMTP_PASSWORD=${SMTP_PASSWORD}
Expand Down
7 changes: 1 addition & 6 deletions server/backend/cron/cronjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package cron
import (
"time"

"github.com/TUM-Dev/Campus-Backend/server/env"

"github.com/TUM-Dev/Campus-Backend/server/model"
"github.com/mmcdole/gofeed"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -42,7 +40,6 @@ func New(db *gorm.DB) *CronService {
}

func (c *CronService) Run() error {
log.WithField("MensaCronActive", env.IsMensaCronActive()).Debug("running cron service")
for {
g := new(errgroup.Group)
log.Trace("Cron: checking for pending")
Expand Down Expand Up @@ -78,9 +75,7 @@ func (c *CronService) Run() error {
case FileDownloadType:
g.Go(func() error { return c.fileDownloadCron() })
case DishNameDownload:
if env.IsMensaCronActive() {
g.Go(c.dishNameDownloadCron)
}
g.Go(func() error { return c.dishNameDownloadCron() })
case MovieType:
g.Go(func() error { return c.movieCron() })
/*
Expand Down
5 changes: 3 additions & 2 deletions server/backend/cron/dish_name_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ func downloadDailyDishes(c *CronService) {
var count int64
var dishId int64
if err := c.db.Model(&model.Dish{}).
Where("name = ? AND cafeteriaID = ? AND type = ?", dish.Name, dish.CafeteriaID, dish.Type).
Select("dish").First(&dishId).
Where("name = ? AND cafeteriaID = ?", dish.Name, dish.CafeteriaID).
Select("dish").
First(&dishId).
Count(&count).Error; err != nil {
log.WithError(err).Error("Error while checking whether this is already in database")
}
Expand Down
19 changes: 0 additions & 19 deletions server/env/environment.go

This file was deleted.

3 changes: 1 addition & 2 deletions server/utils/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package utils
import (
"os"

"github.com/TUM-Dev/Campus-Backend/server/env"
"github.com/getsentry/sentry-go"
"github.com/makasim/sentryhook"
log "github.com/sirupsen/logrus"
Expand All @@ -15,7 +14,7 @@ import (
func SetupTelemetry(Version string) {
environment := "development"
log.SetLevel(log.TraceLevel)
if env.IsProd() {
if os.Getenv("ENVIRONMENT") == "prod" {
log.SetLevel(log.InfoLevel)
environment = "production"
log.SetFormatter(&log.JSONFormatter{}) // simpler to query but harder to parse in the console
Expand Down

0 comments on commit 1a2a16b

Please sign in to comment.