some small fixes

This commit is contained in:
Jan Barfuß 2024-03-27 17:41:57 +01:00
parent 62577d4c41
commit df24f7989f
11 changed files with 278 additions and 279 deletions

View File

@ -5,13 +5,12 @@ import (
"mensa/cache" "mensa/cache"
"mensa/fetch" "mensa/fetch"
"mensa/scrape" "mensa/scrape"
"mensa/types"
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
var c = cache.NewCache() var ca = cache.NewCache()
func Run() { func Run() {
r := gin.Default() r := gin.Default()
@ -28,8 +27,8 @@ func bundesland(c *gin.Context) {
return return
} }
if c.GetCacheData(bundesland) != "" { if ca.GetCacheData(bundesland) != "" {
return c.GetCacheData(bundesland) return ca.GetCacheData(bundesland)
} }
resp, err := fetch.Fetch("bl/" + bundesland) resp, err := fetch.Fetch("bl/" + bundesland)