From 106fd5bfaf61a0fb4268508a162e95bde28ebc89 Mon Sep 17 00:00:00 2001 From: Las Zenow Date: Wed, 15 Aug 2012 20:16:13 +0200 Subject: [PATCH] Regenerate front page in each call --- trantor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trantor.go b/trantor.go index 584b7e9..97412f3 100644 --- a/trantor.go +++ b/trantor.go @@ -35,10 +35,10 @@ type indexData struct { } func indexHandler(coll *mgo.Collection) func(http.ResponseWriter, *http.Request) { - var data indexData - data.Count, _ = coll.Count() - coll.Find(bson.M{}).Sort("-_id").Limit(10).All(&data.Books) return func(w http.ResponseWriter, r *http.Request) { + var data indexData + data.Count, _ = coll.Count() + coll.Find(bson.M{}).Sort("-_id").Limit(10).All(&data.Books) loadTemplate(w, "index", data) } }