Don't make rankings endpoint update user activity
parent
1d54c1ad64
commit
f7ab2719a2
|
@ -8,12 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// /daily/rankings - fetch daily rankings
|
// /daily/rankings - fetch daily rankings
|
||||||
func Rankings(uuid []byte, category, page int) ([]defs.DailyRanking, error) {
|
func Rankings(category, page int) ([]defs.DailyRanking, error) {
|
||||||
err := db.UpdateAccountLastActivity(uuid)
|
|
||||||
if err != nil {
|
|
||||||
log.Print("failed to update account last activity")
|
|
||||||
}
|
|
||||||
|
|
||||||
rankings, err := db.FetchRankings(category, page)
|
rankings, err := db.FetchRankings(category, page)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print("failed to retrieve rankings")
|
log.Print("failed to retrieve rankings")
|
||||||
|
|
|
@ -218,11 +218,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
case "/daily/seed":
|
case "/daily/seed":
|
||||||
w.Write([]byte(daily.Seed()))
|
w.Write([]byte(daily.Seed()))
|
||||||
case "/daily/rankings":
|
case "/daily/rankings":
|
||||||
uuid, err := getUUIDFromRequest(r)
|
var err error
|
||||||
if err != nil {
|
|
||||||
httpError(w, r, err, http.StatusBadRequest)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var category int
|
var category int
|
||||||
if r.URL.Query().Has("category") {
|
if r.URL.Query().Has("category") {
|
||||||
|
@ -242,7 +238,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rankings, err := daily.Rankings(uuid, category, page)
|
rankings, err := daily.Rankings(category, page)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(w, r, err, http.StatusInternalServerError)
|
httpError(w, r, err, http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue