forked from MTSR/mapserver
mtime after incremental run
This commit is contained in:
parent
8c4ec3d863
commit
62bea01d98
@ -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()
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user