cache fix

This commit is contained in:
maddalax 2024-10-01 14:02:32 -05:00
parent 5089dea7a1
commit d37bbd85a5

View file

@ -76,8 +76,11 @@ func ChatRoom(ctx *h.RequestContext) *h.Page {
)
}
var CachedRoomHeader = h.CachedT(time.Hour, func(ctx *h.RequestContext) *h.Element {
return roomNameHeader(ctx)
var CachedRoomHeader = h.CachedPerKeyT(time.Hour, func(ctx *h.RequestContext) (string, h.GetElementFunc) {
roomId := chi.URLParam(ctx.Request, "id")
return roomId, func() *h.Element {
return roomNameHeader(ctx)
}
})
func roomNameHeader(ctx *h.RequestContext) *h.Element {