MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / shouldUsePremium

Function shouldUsePremium

pkg/aiusechat/usechat.go:145–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143}
144
145func shouldUsePremium() bool {
146 info := GetGlobalRateLimit()
147 if info == nil || info.Unknown {
148 return true
149 }
150 if info.PReq > 0 {
151 return true
152 }
153 nowEpoch := time.Now().Unix()
154 if nowEpoch >= info.ResetEpoch {
155 return true
156 }
157 return false
158}
159
160func updateRateLimit(info *uctypes.RateLimitInfo) {
161 if info == nil {

Callers 1

WaveAIPostMessageHandlerFunction · 0.85

Calls 1

GetGlobalRateLimitFunction · 0.85

Tested by

no test coverage detected