From 8e2ff913fc9b204a23c4f589bbf6a81de8032b7e Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sat, 19 Jan 2019 16:44:46 +0100 Subject: [PATCH] throttle down mem consumption (smaller cache) --- mapblockaccessor/mapblockaccessor.go | 7 ++++--- mapserver.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mapblockaccessor/mapblockaccessor.go b/mapblockaccessor/mapblockaccessor.go index ec063e5..8a0304a 100644 --- a/mapblockaccessor/mapblockaccessor.go +++ b/mapblockaccessor/mapblockaccessor.go @@ -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} } diff --git a/mapserver.json b/mapserver.json index 09ec7fd..3bcff76 100644 --- a/mapserver.json +++ b/mapserver.json @@ -1,6 +1,6 @@ { "port": 8080, - "enableinitialrendering": false, + "enableinitialrendering": true, "enableincrementalupdate": true, "webdev": true, "webapi": {