debug
All checks were successful
Deploy / CreateImage (push) Successful in 2m43s
Deploy / ValidateConfig (push) Successful in 29s
Deploy / MigrateDatabase (push) Successful in 49s
Deploy / DeployService (push) Successful in 29s

This commit is contained in:
skeris 2025-06-13 14:13:20 +03:00
parent 9d2fc298c2
commit d508926d85

@ -110,6 +110,7 @@ func (r *GigaChatClient) TokenResearch(ctx context.Context) {
select {
case <-ticker.C:
ttl, err := r.redisClient.TTL(ctx, "gigachat_token").Result()
fmt.Println("GGCHATtoken", ttl, err, ttl<2*time.Minute)
if err != nil || ttl < 2*time.Minute {
if err := r.updateToken(ctx); err != nil {
r.logger.Error("failed to update GigaChat token", zap.Error(err))
@ -147,6 +148,7 @@ func (r *GigaChatClient) updateToken(ctx context.Context) error {
}
ttl := time.Until(time.Unix(respData.ExpiresAt, 0))
fmt.Println("GGCTOKENEXP", respData.ExpiresAt, ttl, ttl<2*time.Minute)
err = r.redisClient.Set(ctx, "gigachat_token", respData.AccessToken, ttl).Err()
if err != nil {
return fmt.Errorf("failed to save token to redis: %w", err)