Fix not possible to create tasks if metrics were enabled
This commit is contained in:
parent
6270bb3e77
commit
707709deb1
1 changed files with 2 additions and 10 deletions
|
@ -72,11 +72,7 @@ func (s *Storage) IncrBy(key string, update int64) (err error) {
|
|||
s.mutex.Lock()
|
||||
defer s.mutex.Unlock()
|
||||
|
||||
v, err := s.Get(key)
|
||||
if err != nil && !e.IsErrValueNotFoundForKey(err) {
|
||||
return err
|
||||
}
|
||||
val, is := v.(int64)
|
||||
val, is := s.store[key].(int64)
|
||||
if !is {
|
||||
return &e.ErrValueHasWrongType{Key: key, ExpectedValue: "int64"}
|
||||
}
|
||||
|
@ -90,11 +86,7 @@ func (s *Storage) DecrBy(key string, update int64) (err error) {
|
|||
s.mutex.Lock()
|
||||
defer s.mutex.Unlock()
|
||||
|
||||
v, err := s.Get(key)
|
||||
if err != nil && !e.IsErrValueNotFoundForKey(err) {
|
||||
return err
|
||||
}
|
||||
val, is := v.(int64)
|
||||
val, is := s.store[key].(int64)
|
||||
if !is {
|
||||
return &e.ErrValueHasWrongType{Key: key, ExpectedValue: "int64"}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue