forked from MTSR/mapserver
mtime after incremental run
This commit is contained in:
parent
8c4ec3d863
commit
62bea01d98
server/tilerendererjob
@ -14,7 +14,6 @@ type InitialRenderEvent struct {
|
|||||||
|
|
||||||
func initialRender(ctx *app.App) {
|
func initialRender(ctx *app.App) {
|
||||||
logrus.Info("Starting initial rendering job")
|
logrus.Info("Starting initial rendering job")
|
||||||
lastMtime := ctx.Settings.GetInt64(settings.SETTING_LAST_MTIME, 0)
|
|
||||||
|
|
||||||
for true {
|
for true {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
@ -25,10 +24,6 @@ func initialRender(ctx *app.App) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if result.LastMtime > lastMtime {
|
|
||||||
lastMtime = result.LastMtime
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(result.List) == 0 && !result.HasMore {
|
if len(result.List) == 0 && !result.HasMore {
|
||||||
ctx.Settings.SetBool(settings.SETTING_INITIAL_RUN, false)
|
ctx.Settings.SetBool(settings.SETTING_INITIAL_RUN, false)
|
||||||
|
|
||||||
@ -62,7 +57,6 @@ func initialRender(ctx *app.App) {
|
|||||||
}
|
}
|
||||||
logrus.WithFields(fields).Info("Initial rendering")
|
logrus.WithFields(fields).Info("Initial rendering")
|
||||||
|
|
||||||
ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, lastMtime)
|
|
||||||
|
|
||||||
//tile gc
|
//tile gc
|
||||||
ctx.TileDB.GC()
|
ctx.TileDB.GC()
|
||||||
|
@ -3,9 +3,16 @@ package tilerendererjob
|
|||||||
import (
|
import (
|
||||||
"mapserver/app"
|
"mapserver/app"
|
||||||
"mapserver/settings"
|
"mapserver/settings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Job(ctx *app.App) {
|
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) {
|
if ctx.Settings.GetBool(settings.SETTING_INITIAL_RUN, true) {
|
||||||
initialRender(ctx)
|
initialRender(ctx)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user