mtime optimization
This commit is contained in:
parent
10b84dc8ee
commit
b0ee7a0464
@ -1,10 +1,11 @@
|
|||||||
package tilerendererjob
|
package tilerendererjob
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"mapserver/app"
|
"mapserver/app"
|
||||||
"mapserver/coords"
|
"mapserver/coords"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
||||||
@ -25,6 +26,9 @@ func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rstate.LastMtime = result.LastMtime
|
||||||
|
ctx.Config.Save()
|
||||||
|
|
||||||
if len(result.List) == 0 {
|
if len(result.List) == 0 {
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
continue
|
continue
|
||||||
@ -32,9 +36,6 @@ func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
|||||||
|
|
||||||
tiles := renderMapblocks(ctx, jobs, result.List)
|
tiles := renderMapblocks(ctx, jobs, result.List)
|
||||||
|
|
||||||
rstate.LastMtime = result.LastMtime
|
|
||||||
ctx.Config.Save()
|
|
||||||
|
|
||||||
t := time.Now()
|
t := time.Now()
|
||||||
elapsed := t.Sub(start)
|
elapsed := t.Sub(start)
|
||||||
|
|
||||||
|
@ -20,4 +20,6 @@ func Job(ctx *app.App) {
|
|||||||
|
|
||||||
incrementalRender(ctx, jobs)
|
incrementalRender(ctx, jobs)
|
||||||
|
|
||||||
|
panic("render job interrupted!")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user