diff --git a/go/tumblrandom/tumblrandom.go b/go/tumblrandom/tumblrandom.go index 3811448d62..d022ee4da4 100644 --- a/go/tumblrandom/tumblrandom.go +++ b/go/tumblrandom/tumblrandom.go @@ -205,7 +205,7 @@ type likesResponse struct { } var ( - refreshBuf map[string][]Post + refreshBuf = map[string][]Post{} refreshBufMu sync.Mutex ) @@ -279,6 +279,9 @@ func (a *app) refreshLikes(rw http.ResponseWriter, r *http.Request) { urlSuffix = lr.Response.Links.Next.Href if urlSuffix != "" { + refreshBufMu.Lock() + refreshBuf[refreshSess] = likes + refreshBufMu.Unlock() fmt.Fprintf(rw, ` @@ -286,8 +289,8 @@ func (a *app) refreshLikes(rw http.ResponseWriter, r *http.Request) {
- - + +