mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 16:48:25 +08:00
Reverted Close() method signature change
This commit is contained in:
@@ -16,7 +16,7 @@ func (s *Storage) Get(key string) ([]byte, error)
|
|||||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Reset() error
|
func (s *Storage) Reset() error
|
||||||
func (s *Storage) Close()
|
func (s *Storage) Close() error
|
||||||
```
|
```
|
||||||
### Installation
|
### Installation
|
||||||
Postgres is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
Postgres is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
@@ -172,10 +172,11 @@ func (s *Storage) Reset() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Close the database
|
// Close the database
|
||||||
func (s *Storage) Close() {
|
func (s *Storage) Close() error {
|
||||||
s.done <- struct{}{}
|
s.done <- struct{}{}
|
||||||
s.db.Stat()
|
s.db.Stat()
|
||||||
s.db.Close()
|
s.db.Close()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// gcTicker starts the gc ticker
|
// gcTicker starts the gc ticker
|
||||||
@@ -209,7 +210,3 @@ func (s *Storage) checkSchema(tableName string) {
|
|||||||
fmt.Printf(checkSchemaMsg, string(data))
|
fmt.Printf(checkSchemaMsg, string(data))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Storage) DB() *pgxpool.Pool {
|
|
||||||
return s.db
|
|
||||||
}
|
|
||||||
|
@@ -174,3 +174,7 @@ func Test_SslRequiredMode(t *testing.T) {
|
|||||||
SslMode: "require",
|
SslMode: "require",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_Postgres_Close(t *testing.T) {
|
||||||
|
utils.AssertEqual(t, nil, testStore.Close())
|
||||||
|
}
|
Reference in New Issue
Block a user