mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-23 06:06:16 -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 {
|
if now := time.Now(); now.Sub(wasLastUsed) > 1*time.Hour {
|
||||||
token.LastUsed = now
|
token.LastUsed = now
|
||||||
if err := ts.state.DB.UpdateToken(ctx, token, "last_used"); err != nil {
|
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)
|
err := gtserror.Newf("error updating last_used on token: %w", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue