1
0
mirror of https://github.com/ebosas/microservices.git synced 2025-06-12 22:17:26 +02:00

Cache, messages page

This commit is contained in:
ebosas
2021-10-10 18:49:39 +03:00
parent 5357502b71
commit 27e472d692
14 changed files with 184 additions and 389 deletions

View File

@ -9,13 +9,13 @@ import (
"github.com/go-redis/redis/v8"
)
// handleAPICache handles API calls for cached messages
// handleAPICache handles API calls for cached messages.
func handleAPICache(cr *redis.Client) func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
data, err := cache.GetCacheJSON(cr)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("500 - Something happened"))
w.Write([]byte("500 Something went wrong"))
log.Printf("get cache json: %s", err)
return