MCPcopy Create free account
hub / github.com/gogs/gogs / AfterFind

Method AfterFind

internal/database/access_tokens.go:41–49  ·  view source on GitHub ↗

AfterFind implements the GORM query hook.

(tx *gorm.DB)

Source from the content-addressed store, hash-verified

39
40// AfterFind implements the GORM query hook.
41func (t *AccessToken) AfterFind(tx *gorm.DB) error {
42 t.Created = time.Unix(t.CreatedUnix, 0).Local()
43 if t.UpdatedUnix > 0 {
44 t.Updated = time.Unix(t.UpdatedUnix, 0).Local()
45 t.HasUsed = t.Updated.After(t.Created)
46 t.HasRecentActivity = t.Updated.Add(7 * 24 * time.Hour).After(tx.NowFunc())
47 }
48 return nil
49}
50
51// AccessTokensStore is the storage layer for access tokens.
52type AccessTokensStore struct {

Callers 1

Calls 1

AddMethod · 0.80

Tested by 1