feat: extend voices cache expiry to 24 hours for improved performance

This commit is contained in:
王锦强
2025-03-11 23:33:54 +08:00
parent 1e0c5e4129
commit 869080287e

View File

@@ -173,7 +173,7 @@ func (c *Client) ListVoices(ctx context.Context, locale string) ([]models.Voice,
// 更新缓存
c.voicesCacheMu.Lock()
c.voicesCache = voices
c.voicesCacheExpiry = time.Now().Add(1 * time.Hour) // 缓存1小时
c.voicesCacheExpiry = time.Now().Add(24 * time.Hour) // 缓存24小时
c.voicesCacheMu.Unlock()
// 如果指定了locale则过滤结果