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

Method Delete

model/token.go:231–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229}
230
231func (token *Token) Delete() (err error) {
232 defer func() {
233 if shouldUpdateRedis(true, err) {
234 gopool.Go(func() {
235 err := cacheDeleteToken(token.Key)
236 if err != nil {
237 common.SysError("failed to delete token cache: " + err.Error())
238 }
239 })
240 }
241 }()
242 err = DB.Delete(token).Error
243 return err
244}
245
246func (token *Token) IsModelLimitsEnabled() bool {
247 return token.ModelLimitsEnabled

Callers 2

DeleteTokenByIdFunction · 0.95
BatchDeleteTokensFunction · 0.45

Calls 4

SysErrorFunction · 0.92
shouldUpdateRedisFunction · 0.85
cacheDeleteTokenFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected