🥽 update test

This commit is contained in:
Fenny
2020-11-05 05:34:56 +01:00
parent 6fa1b0ebdb
commit 504e8c31f8
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
on: [push, pull_request] on: [push, pull_request]
name: Test name: Memory Test
jobs: jobs:
Build: Build:
strategy: strategy:

View File

@@ -104,6 +104,9 @@ func (s *Storage) Get(key string) ([]byte, error) {
item := s.acquireItem() item := s.acquireItem()
if err := res.Err(); err != nil { if err := res.Err(); err != nil {
if err == mongo.ErrNoDocuments {
return nil, ErrNotExist
}
return nil, err return nil, err
} }
if err := res.Decode(&item); err != nil { if err := res.Decode(&item); err != nil {
@@ -111,7 +114,7 @@ func (s *Storage) Get(key string) ([]byte, error) {
} }
if !item.Expiration.IsZero() && item.Expiration.Unix() <= time.Now().Unix() { if !item.Expiration.IsZero() && item.Expiration.Unix() <= time.Now().Unix() {
return nil, nil return nil, ErrNotExist
} }
// // not safe? // // not safe?
// res := item.Val // res := item.Val