mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-22 22:36:14 -06:00
cheeky little time optimization
This commit is contained in:
parent
668dbf2b4d
commit
d5f4254862
1 changed files with 2 additions and 2 deletions
|
|
@ -204,8 +204,8 @@ func (ts *tokenStore) getUpdateToken(
|
||||||
// If token was last used more than
|
// If token was last used more than
|
||||||
// an hour ago, update this in the db.
|
// an hour ago, update this in the db.
|
||||||
wasLastUsed := token.LastUsed
|
wasLastUsed := token.LastUsed
|
||||||
if time.Since(wasLastUsed) > 1*time.Hour {
|
if now := time.Now(); now.Sub(wasLastUsed) > 1*time.Hour {
|
||||||
token.LastUsed = time.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 {
|
||||||
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