forked from MTSR/mapserver
remove mutex on tiledb
This commit is contained in:
parent
6ea40e1c16
commit
0fe22caef6
@ -1,16 +1,14 @@
|
|||||||
package tiledb
|
package tiledb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"mapserver/coords"
|
"mapserver/coords"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
var mutex = &sync.RWMutex{}
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
func New(path string) (*TileDB, error) {
|
func New(path string) (*TileDB, error) {
|
||||||
return &TileDB{
|
return &TileDB{
|
||||||
@ -40,9 +38,6 @@ func (this *TileDB) GetTile(pos *coords.TileCoords) ([]byte, error) {
|
|||||||
timer := prometheus.NewTimer(tiledbLoadDuration)
|
timer := prometheus.NewTimer(tiledbLoadDuration)
|
||||||
defer timer.ObserveDuration()
|
defer timer.ObserveDuration()
|
||||||
|
|
||||||
mutex.RLock()
|
|
||||||
defer mutex.RUnlock()
|
|
||||||
|
|
||||||
fields := logrus.Fields{
|
fields := logrus.Fields{
|
||||||
"pos": pos,
|
"pos": pos,
|
||||||
}
|
}
|
||||||
@ -66,9 +61,6 @@ func (this *TileDB) SetTile(pos *coords.TileCoords, tile []byte) error {
|
|||||||
timer := prometheus.NewTimer(tiledbSaveDuration)
|
timer := prometheus.NewTimer(tiledbSaveDuration)
|
||||||
defer timer.ObserveDuration()
|
defer timer.ObserveDuration()
|
||||||
|
|
||||||
mutex.Lock()
|
|
||||||
defer mutex.Unlock()
|
|
||||||
|
|
||||||
fields := logrus.Fields{
|
fields := logrus.Fields{
|
||||||
"pos": pos,
|
"pos": pos,
|
||||||
"size": len(tile),
|
"size": len(tile),
|
||||||
|
Loading…
Reference in New Issue
Block a user