mapserver/server/tilerendererjob/job.go
2019-01-29 18:00:00 +01:00

39 lines
627 B
Go

package tilerendererjob
import (
"mapserver/app"
"mapserver/coords"
)
func Job(ctx *app.App) {
rstate := ctx.Config.RenderState
jobs := make(chan *coords.TileCoords, ctx.Config.RenderingQueue)
for i := 0; i < ctx.Config.RenderingJobs; i++ {
go worker(ctx, jobs)
}
if rstate.InitialRun {
//fast, unsafe mode
err := ctx.Objectdb.EnableSpeedSafetyTradeoff(true)
if err != nil {
panic(err)
}
initialRender(ctx, jobs)
//normal, safe mode
err = ctx.Objectdb.EnableSpeedSafetyTradeoff(false)
if err != nil {
panic(err)
}
}
incrementalRender(ctx, jobs)
panic("render job interrupted!")
}