1
0
forked from MTSR/mapserver
mapserver/server/tilerendererjob/worker.go

30 lines
530 B
Go
Raw Normal View History

2019-01-24 17:56:37 +03:00
package tilerendererjob
import (
"mapserver/app"
"mapserver/coords"
2019-02-19 10:33:38 +03:00
"github.com/sirupsen/logrus"
2019-01-24 17:56:37 +03:00
)
2019-02-20 12:10:00 +03:00
func worker(ctx *app.App, coords <-chan *coords.TileCoords, done chan bool) {
2019-01-24 17:56:37 +03:00
for tc := range coords {
2019-01-27 20:34:04 +03:00
//render tile
2019-02-19 10:33:38 +03:00
fields := logrus.Fields{
"X": tc.X,
"Y": tc.Y,
"Zoom": tc.Zoom,
"LayerId": tc.LayerId,
"prefix": "tilerenderjob",
}
logrus.WithFields(fields).Debug("Tile render job tile")
2019-02-07 21:48:05 +03:00
_, err := ctx.Tilerenderer.Render(tc)
2019-01-24 17:56:37 +03:00
if err != nil {
panic(err)
}
}
2019-02-20 12:10:00 +03:00
done <- true
2019-01-24 17:56:37 +03:00
}