These are chat archives for gin-gonic/gin

26th
Jun 2017
Eason Lin
@easonlin404
Jun 26 2017 16:09
maybe can consider to introduce embedded binary files
instead of template static files in gin. And update embedded files without restarting the server.
or graceful restart server and no downtime :smile:
Thomas Boerger
@tboerger
Jun 26 2017 16:16
That doesn't solve my problem. And graceful restart is not an option for me because the gin app requires really long to start
Eason Lin
@easonlin404
Jun 26 2017 16:55
if reload templates on every request ? like this:
Thomas Boerger
@tboerger
Jun 26 2017 17:08
    if tmpl, err := template.New("").Funcs(funcMap).ParseGlob("assets/templates/*"); err == nil {
        router.SetHTMLTemplate(tmpl)
    } else {
        log.Fatalf("Error while loading templates: %v", err)
    }
currently i got this and i need to restart the server to update templates within development -.-
before that the app used LoadHTMLGlob which updates the templates on every request.
Thomas Boerger
@tboerger
Jun 26 2017 17:58
@appleboy got a good idea how to make it possible to provide a funcmap and still keep template reload on every request?
Thomas Boerger
@tboerger
Jun 26 2017 18:49