mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-03 12:14:06 +09:00
Pass the req context when pinging the DB
This commit is contained in:
1 parent
4527801d48
commit
f23e9dc235
2 files changed
+3
-3
No files matched your search
@@ -221,8 +221,8 @@ func (h *Headscale) setValue(key string, value string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Headscale) pingDB() error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
func (h *Headscale) pingDB(ctx context.Context) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, time.Second)
|
||||
defer cancel()
|
||||
db, err := h.db.DB()
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user