GetMapData change to read lock

This commit is contained in:
didi 2019-09-09 17:44:10 +08:00
parent 8395a26061
commit 6d47b4a2e0
1 changed files with 2 additions and 2 deletions

View File

@ -117,8 +117,8 @@ func (m *URLMap) GetMap() map[string]interface{} {
// GetMapData return all mapdata
func (m *URLMap) GetMapData() []map[string]interface{} {
m.lock.Lock()
defer m.lock.Unlock()
m.lock.RLock()
defer m.lock.RUnlock()
var resultLists []map[string]interface{}