forked from MTSR/mapserver
rendering limit params
This commit is contained in:
parent
13cab545b1
commit
1c8694c906
@ -17,6 +17,8 @@ type Config struct {
|
|||||||
WebApi *WebApiConfig `json:"webapi"`
|
WebApi *WebApiConfig `json:"webapi"`
|
||||||
RenderState *RenderStateType `json:"renderstate"`
|
RenderState *RenderStateType `json:"renderstate"`
|
||||||
Layers []layer.Layer `json:"layers"`
|
Layers []layer.Layer `json:"layers"`
|
||||||
|
InitialRenderingFetchLimit int `json:"initialrenderingfetchlimit"`
|
||||||
|
UpdateRenderingFetchLimit int `json:"updaterenderingfetchlimit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WebApiConfig struct {
|
type WebApiConfig struct {
|
||||||
@ -95,6 +97,8 @@ func ParseConfig(filename string) (*Config, error) {
|
|||||||
WebApi: &webapi,
|
WebApi: &webapi,
|
||||||
RenderState: &rstate,
|
RenderState: &rstate,
|
||||||
Layers: layers,
|
Layers: layers,
|
||||||
|
InitialRenderingFetchLimit: 10000,
|
||||||
|
UpdateRenderingFetchLimit: 10000,
|
||||||
}
|
}
|
||||||
|
|
||||||
info, err := os.Stat(filename)
|
info, err := os.Stat(filename)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package coords
|
package coords
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"mapserver/layer"
|
"mapserver/layer"
|
||||||
|
"math"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package coords
|
package coords
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
"mapserver/layer"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"mapserver/layer"
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConvertMapblockToTile1(t *testing.T) {
|
func TestConvertMapblockToTile1(t *testing.T) {
|
||||||
|
@ -17,7 +17,7 @@ func Job(ctx *app.App) {
|
|||||||
lastcoords := coords.NewMapBlockCoords(rstate.LastX, rstate.LastY, rstate.LastZ)
|
lastcoords := coords.NewMapBlockCoords(rstate.LastX, rstate.LastY, rstate.LastZ)
|
||||||
|
|
||||||
for true {
|
for true {
|
||||||
newlastcoords, mblist, err := ctx.BlockAccessor.FindLegacyMapBlocks(lastcoords, 10000)
|
newlastcoords, mblist, err := ctx.BlockAccessor.FindLegacyMapBlocks(lastcoords, ctx.Config.InitialRenderingFetchLimit)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -2,8 +2,8 @@ package mapblockparser
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"strconv"
|
|
||||||
"mapserver/coords"
|
"mapserver/coords"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Parse(data []byte, mtime int64, pos coords.MapBlockCoords) (*MapBlock, error) {
|
func Parse(data []byte, mtime int64, pos coords.MapBlockCoords) (*MapBlock, error) {
|
||||||
|
@ -3,9 +3,9 @@ package mapblockparser
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"mapserver/coords"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
"mapserver/coords"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReadU16(t *testing.T) {
|
func TestReadU16(t *testing.T) {
|
||||||
|
@ -7,9 +7,9 @@ import (
|
|||||||
"mapserver/colormapping"
|
"mapserver/colormapping"
|
||||||
"mapserver/coords"
|
"mapserver/coords"
|
||||||
"mapserver/db"
|
"mapserver/db"
|
||||||
|
"mapserver/layer"
|
||||||
"mapserver/mapblockaccessor"
|
"mapserver/mapblockaccessor"
|
||||||
"mapserver/testutils"
|
"mapserver/testutils"
|
||||||
"mapserver/layer"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
@ -17,7 +17,7 @@ func Job(ctx *app.App) {
|
|||||||
logrus.WithFields(fields).Info("Starting incremental update")
|
logrus.WithFields(fields).Info("Starting incremental update")
|
||||||
|
|
||||||
for true {
|
for true {
|
||||||
mblist, err := ctx.BlockAccessor.FindLatestMapBlocks(rstate.LastMtime, 10000)
|
mblist, err := ctx.BlockAccessor.FindLatestMapBlocks(rstate.LastMtime, ctx.Config.UpdateRenderingFetchLimit)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -71,6 +71,7 @@ func Job(ctx *app.App) {
|
|||||||
if len(mblist) > 0 {
|
if len(mblist) > 0 {
|
||||||
fields = logrus.Fields{
|
fields = logrus.Fields{
|
||||||
"count": len(mblist),
|
"count": len(mblist),
|
||||||
|
"validcount": len(validmblist),
|
||||||
"lastmtime": rstate.LastMtime,
|
"lastmtime": rstate.LastMtime,
|
||||||
}
|
}
|
||||||
logrus.WithFields(fields).Info("incremental update")
|
logrus.WithFields(fields).Info("incremental update")
|
||||||
|
Loading…
Reference in New Issue
Block a user