initial rendering disable option

This commit is contained in:
Thomas Rudin 2019-03-29 21:05:53 +01:00
parent ce4ac4dfc9
commit a48e2c2678
2 changed files with 30 additions and 26 deletions

View File

@ -13,6 +13,7 @@ type Config struct {
Port int `json:"port"` Port int `json:"port"`
EnablePrometheus bool `json:"enableprometheus"` EnablePrometheus bool `json:"enableprometheus"`
EnableRendering bool `json:"enablerendering"` EnableRendering bool `json:"enablerendering"`
EnableInitialRendering bool `json:"enableinitialrendering"`
EnableTransparency bool `json:"enabletransparency"` EnableTransparency bool `json:"enabletransparency"`
Webdev bool `json:"webdev"` Webdev bool `json:"webdev"`
WebApi *WebApiConfig `json:"webapi"` WebApi *WebApiConfig `json:"webapi"`
@ -140,6 +141,7 @@ func ParseConfig(filename string) (*Config, error) {
Port: 8080, Port: 8080,
EnableRendering: true, EnableRendering: true,
EnablePrometheus: true, EnablePrometheus: true,
EnableInitialRendering: true,
EnableTransparency: true, EnableTransparency: true,
Webdev: false, Webdev: false,
WebApi: &webapi, WebApi: &webapi,

View File

@ -13,9 +13,11 @@ func Job(ctx *app.App) {
ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, time.Now().Unix()) ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, time.Now().Unix())
} }
if ctx.Config.EnableInitialRendering {
if ctx.Settings.GetBool(settings.SETTING_INITIAL_RUN, true) { if ctx.Settings.GetBool(settings.SETTING_INITIAL_RUN, true) {
initialRender(ctx) initialRender(ctx)
} }
}
incrementalRender(ctx) incrementalRender(ctx)