fix tile glitch
This commit is contained in:
parent
dc7c1e58d1
commit
9a249a92e9
1
server/.gitignore
vendored
1
server/.gitignore
vendored
@ -6,3 +6,4 @@ mapserver.tiles
|
||||
mapserver.sqlite
|
||||
mapserver.sqlite-journal
|
||||
mapserver.json
|
||||
debug.txt
|
||||
|
11
server/tiledb/logger.go
Normal file
11
server/tiledb/logger.go
Normal file
@ -0,0 +1,11 @@
|
||||
package tiledb
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var log *logrus.Entry
|
||||
|
||||
func init() {
|
||||
log = logrus.WithFields(logrus.Fields{"prefix": "tiledb"})
|
||||
}
|
@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var mutex = &sync.RWMutex{}
|
||||
@ -38,6 +39,11 @@ func (this *TileDB) GetTile(pos *coords.TileCoords) ([]byte, error) {
|
||||
mutex.RLock()
|
||||
defer mutex.RUnlock()
|
||||
|
||||
fields := logrus.Fields{
|
||||
"pos": pos,
|
||||
}
|
||||
log.WithFields(fields).Debug("GetTile")
|
||||
|
||||
_, file := this.getDirAndFile(pos)
|
||||
info, _ := os.Stat(file)
|
||||
if info != nil {
|
||||
@ -56,6 +62,12 @@ func (this *TileDB) SetTile(pos *coords.TileCoords, tile []byte) error {
|
||||
mutex.Lock()
|
||||
defer mutex.Unlock()
|
||||
|
||||
fields := logrus.Fields{
|
||||
"pos": pos,
|
||||
"size": len(tile),
|
||||
}
|
||||
log.WithFields(fields).Debug("SetTile")
|
||||
|
||||
dir, file := this.getDirAndFile(pos)
|
||||
os.MkdirAll(dir, 0700)
|
||||
|
||||
|
@ -72,8 +72,11 @@ func renderMapblocks(ctx *app.App, mblist []*mapblockparser.MapBlock) int {
|
||||
|
||||
//spin down worker pool
|
||||
close(jobs)
|
||||
|
||||
for j := 0; j < ctx.Config.RenderingJobs; j++ {
|
||||
<-done
|
||||
}
|
||||
}
|
||||
|
||||
return tilecount
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user