feat: readiness check (#1839)

* feat: readiness check

* fix: no need for query param

* docs: add a note

* chore: move the readyness check to its own endpoint

* docs(cr): add godoc

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
This commit is contained in:
Kobi Meirson
2022-12-23 09:08:12 +00:00
committed by GitHub
co-authored by Joel Speed
parent 8b77c97009
commit f753ec1ca5
23 changed files with 382 additions and 35 deletions
+1
View File
@@ -15,4 +15,5 @@ type Store interface {
Load(context.Context, string) ([]byte, error)
Clear(context.Context, string) error
Lock(key string) sessions.Lock
VerifyConnection(context.Context) error
}
+6
View File
@@ -1,6 +1,7 @@
package persistence
import (
"context"
"fmt"
"net/http"
"time"
@@ -90,3 +91,8 @@ func (m *Manager) Clear(rw http.ResponseWriter, req *http.Request) error {
return m.Store.Clear(req.Context(), key)
})
}
// VerifyConnection validates the underlying store is ready and connected
func (m *Manager) VerifyConnection(ctx context.Context) error {
return m.Store.VerifyConnection(ctx)
}