You've already forked microservices
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:
@ -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
|
||||
|
Reference in New Issue
Block a user