All caches is now protected with mutexes.

This commit is contained in:
2016-12-13 04:58:31 +05:00
parent 384754276a
commit 2997abf1aa
3 changed files with 11 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ package cache
import (
// stdlib
"fmt"
"sync"
// local
"github.com/pztrn/urtrator/cachemodels"
@@ -20,8 +21,12 @@ import (
type Cache struct {
// Profiles cache.
Profiles map[string]*cachemodels.Profile
// Profiles cache mutex.
ProfilesMutex sync.Mutex
// Servers cache.
Servers map[string]*cachemodels.Server
// Servers cache mutex.
ServersMutex sync.Mutex
}
func (c *Cache) Initialize() {