2019-01-24 09:52:25 +03:00
|
|
|
package tilerendererjob
|
|
|
|
|
|
|
|
import (
|
|
|
|
"mapserver/app"
|
2019-02-07 20:44:40 +03:00
|
|
|
"mapserver/settings"
|
2019-01-24 09:52:25 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func Job(ctx *app.App) {
|
2019-02-22 17:24:10 +03:00
|
|
|
lastMtime := ctx.Settings.GetInt64(settings.SETTING_LAST_MTIME, 0)
|
|
|
|
if lastMtime == 0 {
|
2019-04-03 09:18:44 +03:00
|
|
|
//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)
|
2019-02-22 17:24:10 +03:00
|
|
|
}
|
|
|
|
|
2019-03-29 23:05:53 +03:00
|
|
|
if ctx.Config.EnableInitialRendering {
|
|
|
|
if ctx.Settings.GetBool(settings.SETTING_INITIAL_RUN, true) {
|
|
|
|
initialRender(ctx)
|
|
|
|
}
|
2019-01-24 17:56:37 +03:00
|
|
|
}
|
2019-01-24 09:52:25 +03:00
|
|
|
|
2019-02-20 12:10:00 +03:00
|
|
|
incrementalRender(ctx)
|
2019-01-24 09:52:25 +03:00
|
|
|
|
2019-01-25 19:57:38 +03:00
|
|
|
panic("render job interrupted!")
|
|
|
|
|
2019-01-24 09:52:25 +03:00
|
|
|
}
|