mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 16:48:25 +08:00
🥽 update test
This commit is contained in:
2
.github/workflows/test-memory.yml
vendored
2
.github/workflows/test-memory.yml
vendored
@@ -1,5 +1,5 @@
|
||||
on: [push, pull_request]
|
||||
name: Test
|
||||
name: Memory Test
|
||||
jobs:
|
||||
Build:
|
||||
strategy:
|
||||
|
@@ -104,6 +104,9 @@ func (s *Storage) Get(key string) ([]byte, error) {
|
||||
item := s.acquireItem()
|
||||
|
||||
if err := res.Err(); err != nil {
|
||||
if err == mongo.ErrNoDocuments {
|
||||
return nil, ErrNotExist
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
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() {
|
||||
return nil, nil
|
||||
return nil, ErrNotExist
|
||||
}
|
||||
// // not safe?
|
||||
// res := item.Val
|
||||
|
Reference in New Issue
Block a user