1
0
forked from MTSR/mapserver

throttle down mem consumption (smaller cache)

This commit is contained in:
Thomas Rudin 2019-01-19 16:44:46 +01:00
parent 624f6b2914
commit 8e2ff913fc
2 changed files with 5 additions and 4 deletions

View File

@ -2,12 +2,13 @@ package mapblockaccessor
import (
"fmt"
"github.com/patrickmn/go-cache"
"github.com/sirupsen/logrus"
"mapserver/coords"
"mapserver/db"
"mapserver/mapblockparser"
"time"
cache "github.com/patrickmn/go-cache"
"github.com/sirupsen/logrus"
)
type MapBlockAccessor struct {
@ -25,7 +26,7 @@ func getKey(pos coords.MapBlockCoords) string {
}
func NewMapBlockAccessor(accessor db.DBAccessor) *MapBlockAccessor {
c := cache.New(5*time.Minute, 10*time.Minute)
c := cache.New(1*time.Second, 2*time.Second)
return &MapBlockAccessor{accessor: accessor, c: c}
}

View File

@ -1,6 +1,6 @@
{
"port": 8080,
"enableinitialrendering": false,
"enableinitialrendering": true,
"enableincrementalupdate": true,
"webdev": true,
"webapi": {