use write lock when updating container stats
Signed-off-by: Michael Crosby <michael@thepasture.io>
This commit is contained in:
parent
195def141f
commit
6765524b73
@ -170,8 +170,8 @@ func (s *Store) List() []Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Store) UpdateContainerStats(id string, newContainerStats *stats.ContainerStats) error {
|
func (s *Store) UpdateContainerStats(id string, newContainerStats *stats.ContainerStats) error {
|
||||||
s.lock.RLock()
|
s.lock.Lock()
|
||||||
defer s.lock.RUnlock()
|
defer s.lock.Unlock()
|
||||||
id, err := s.idIndex.Get(id)
|
id, err := s.idIndex.Get(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == truncindex.ErrNotExist {
|
if err == truncindex.ErrNotExist {
|
||||||
|
Loading…
Reference in New Issue
Block a user