Fix differences print out on check

This commit is contained in:
Nick Craig-Wood
2013-07-02 08:33:17 +01:00
parent 7153b05342
commit 754c54b64f
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -106,10 +106,17 @@ func (s *StatsInfo) Errors(errors int64) {
s.errors += errors
}
// GetErrors reads the number of errors
func (s *StatsInfo) GetErrors() int64 {
s.lock.RLock()
defer s.lock.RUnlock()
return s.errors
}
// Errored returns whether there have been any errors
func (s *StatsInfo) Errored() bool {
s.lock.Lock()
defer s.lock.Unlock()
s.lock.RLock()
defer s.lock.RUnlock()
return s.errors != 0
}