1
0
forked from MTSR/mapserver

mtime after incremental run

This commit is contained in:
NatureFreshMilk 2019-02-22 15:24:10 +01:00
parent 8c4ec3d863
commit 62bea01d98
2 changed files with 7 additions and 6 deletions

View File

@ -14,7 +14,6 @@ type InitialRenderEvent struct {
func initialRender(ctx *app.App) {
logrus.Info("Starting initial rendering job")
lastMtime := ctx.Settings.GetInt64(settings.SETTING_LAST_MTIME, 0)
for true {
start := time.Now()
@ -25,10 +24,6 @@ func initialRender(ctx *app.App) {
panic(err)
}
if result.LastMtime > lastMtime {
lastMtime = result.LastMtime
}
if len(result.List) == 0 && !result.HasMore {
ctx.Settings.SetBool(settings.SETTING_INITIAL_RUN, false)
@ -62,7 +57,6 @@ func initialRender(ctx *app.App) {
}
logrus.WithFields(fields).Info("Initial rendering")
ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, lastMtime)
//tile gc
ctx.TileDB.GC()

View File

@ -3,9 +3,16 @@ package tilerendererjob
import (
"mapserver/app"
"mapserver/settings"
"time"
)
func Job(ctx *app.App) {
lastMtime := ctx.Settings.GetInt64(settings.SETTING_LAST_MTIME, 0)
if lastMtime == 0 {
//mark current time as last incremental render point
ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, time.Now().Unix())
}
if ctx.Settings.GetBool(settings.SETTING_INITIAL_RUN, true) {
initialRender(ctx)
}