Fix not possible to create tasks if metrics were enabled
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2020-10-20 20:28:44 +02:00
parent 6270bb3e77
commit 707709deb1
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 10 deletions

View File

@ -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"}
}