mtime optimization

This commit is contained in:
Thomas Rudin 2019-01-25 17:57:38 +01:00
parent 10b84dc8ee
commit b0ee7a0464
2 changed files with 7 additions and 4 deletions

View File

@ -1,10 +1,11 @@
package tilerendererjob
import (
"github.com/sirupsen/logrus"
"mapserver/app"
"mapserver/coords"
"time"
"github.com/sirupsen/logrus"
)
func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
@ -25,6 +26,9 @@ func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
panic(err)
}
rstate.LastMtime = result.LastMtime
ctx.Config.Save()
if len(result.List) == 0 {
time.Sleep(5 * time.Second)
continue
@ -32,9 +36,6 @@ func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
tiles := renderMapblocks(ctx, jobs, result.List)
rstate.LastMtime = result.LastMtime
ctx.Config.Save()
t := time.Now()
elapsed := t.Sub(start)

View File

@ -20,4 +20,6 @@ func Job(ctx *app.App) {
incrementalRender(ctx, jobs)
panic("render job interrupted!")
}