MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / SelectUpdate

Method SelectUpdate

model/token.go:216–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214}
215
216func (token *Token) SelectUpdate() (err error) {
217 defer func() {
218 if shouldUpdateRedis(true, err) {
219 gopool.Go(func() {
220 err := cacheSetToken(*token)
221 if err != nil {
222 common.SysError("failed to update token cache: " + err.Error())
223 }
224 })
225 }
226 }()
227 // This can update zero values
228 return DB.Model(token).Select("accessed_time", "status").Updates(token).Error
229}
230
231func (token *Token) Delete() (err error) {
232 defer func() {

Callers 1

ValidateUserTokenFunction · 0.45

Calls 4

SysErrorFunction · 0.92
shouldUpdateRedisFunction · 0.85
cacheSetTokenFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected