diff --git a/server/tilerendererjob/incremental.go b/server/tilerendererjob/incremental.go index 95a3c75..2c4323f 100644 --- a/server/tilerendererjob/incremental.go +++ b/server/tilerendererjob/incremental.go @@ -49,14 +49,11 @@ func incrementalRender(ctx *app.App) { ctx.WebEventbus.Emit("incremental-render-progress", &ev) - millisDiff := time.Now().Unix() - result.LastMtime - fields := logrus.Fields{ - "mapblocks": len(result.List), - "tiles": tiles, - "elapsed": elapsed, - "lastMtime": result.LastMtime, - "secondsDiff": millisDiff / 1000, + "mapblocks": len(result.List), + "tiles": tiles, + "elapsed": elapsed, + "lastMtime": result.LastMtime, } logrus.WithFields(fields).Info("incremental rendering") diff --git a/server/tilerendererjob/job.go b/server/tilerendererjob/job.go index 0532708..6c734cf 100644 --- a/server/tilerendererjob/job.go +++ b/server/tilerendererjob/job.go @@ -3,14 +3,19 @@ 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()) + //mark db time as last incremental render point + lastMtime, err := ctx.Blockdb.GetTimestamp() + + if err != nil { + panic(err) + } + + ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, lastMtime) } if ctx.Config.EnableInitialRendering {