introduce rw lock for db, ish...
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
a1a3ff4ba8
commit
eff529f2c5
12 changed files with 369 additions and 156 deletions
|
@ -275,8 +275,11 @@ func (api headscaleV1APIServer) ExpireMachine(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
api.h.db.ExpireMachine(
|
||||
now := time.Now()
|
||||
|
||||
api.h.db.MachineSetExpiry(
|
||||
machine,
|
||||
now,
|
||||
)
|
||||
|
||||
log.Trace().
|
||||
|
@ -358,7 +361,7 @@ func (api headscaleV1APIServer) MoveMachine(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
err = api.h.db.SetMachineUser(machine, request.GetUser())
|
||||
err = api.h.db.AssignMachineToUser(machine, request.GetUser())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue