don't panic, log errors

This commit is contained in:
NatureFreshMilk 2019-02-25 07:29:31 +01:00
parent f3935f786c
commit 9be625fae4
4 changed files with 17 additions and 3 deletions

View File

@ -128,6 +128,13 @@ func (tr *TileRenderer) renderImage(tc *coords.TileCoords, recursionDepth int) (
img, err := tr.mapblockrenderer.Render(mbr.Pos1, mbr.Pos2)
if err != nil {
fields := logrus.Fields{
"pos1": mbr.Pos1,
"pos2": mbr.Pos2,
"err": err,
}
log.WithFields(fields).Debug("mapblock render from tilerender")
return nil, nil, err
}

View File

@ -2,6 +2,7 @@ package tilerenderer
import (
"bytes"
"github.com/sirupsen/logrus"
"io/ioutil"
"mapserver/colormapping"
"mapserver/coords"
@ -14,7 +15,6 @@ import (
"os"
"testing"
"time"
"github.com/sirupsen/logrus"
)
func TestTileRender(t *testing.T) {

View File

@ -57,7 +57,6 @@ func initialRender(ctx *app.App) {
}
logrus.WithFields(fields).Info("Initial rendering")
//tile gc
ctx.TileDB.GC()

View File

@ -21,7 +21,15 @@ func worker(ctx *app.App, coords <-chan *coords.TileCoords, done chan bool) {
_, err := ctx.Tilerenderer.Render(tc)
if err != nil {
panic(err)
fields := logrus.Fields{
"X": tc.X,
"Y": tc.Y,
"Zoom": tc.Zoom,
"LayerId": tc.LayerId,
"prefix": "tilerenderjob",
"err": err,
}
logrus.WithFields(fields).Error("Tile render job tile")
}
}