use timestamp from db
This commit is contained in:
parent
33d30bc91d
commit
0a986952a8
@ -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")
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user