mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-23 15:26:20 -06:00
unlock on error
This commit is contained in:
parent
d5f4254862
commit
ea44883d2c
1 changed files with 2 additions and 0 deletions
|
|
@ -207,6 +207,8 @@ func (ts *tokenStore) getUpdateToken(
|
|||
if now := time.Now(); now.Sub(wasLastUsed) > 1*time.Hour {
|
||||
token.LastUsed = now
|
||||
if err := ts.state.DB.UpdateToken(ctx, token, "last_used"); err != nil {
|
||||
// Unlock on error.
|
||||
unlock()
|
||||
err := gtserror.Newf("error updating last_used on token: %w", err)
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue