1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Parallelization.

This commit is contained in:
Ferdinand Mütsch
2019-05-19 21:00:19 +02:00
parent 1caf962917
commit cc1a9bbca1
4 changed files with 40 additions and 10 deletions

View File

@ -2,7 +2,6 @@ package routes
import (
"crypto/md5"
"fmt"
"net/http"
"strconv"
"time"
@ -64,7 +63,6 @@ func (h *SummaryHandler) Get(w http.ResponseWriter, r *http.Request) {
cacheKey := getHash([]time.Time{from, to})
if _, ok := summaryCache[cacheKey]; !ok {
// Cache Miss
fmt.Println("Cache miss")
summary, err = h.SummarySrvc.GetSummary(from, to, user) // 'to' is always constant
if err != nil {
w.WriteHeader(http.StatusInternalServerError)