fix: 添加凭证过期调试日志并移除冗余日志
添加Qwen凭证过期检查的调试日志以便排查问题 移除api-server中冗余的token刷新成功日志
This commit is contained in:
parent
484d71fcd3
commit
13defe0622
2 changed files with 2 additions and 1 deletions
|
|
@ -700,7 +700,7 @@ async function startServer() {
|
||||||
// For pooled providers, refreshToken should be handled by individual instances
|
// For pooled providers, refreshToken should be handled by individual instances
|
||||||
// For single instances, this remains relevant
|
// For single instances, this remains relevant
|
||||||
await serviceAdapter.refreshToken();
|
await serviceAdapter.refreshToken();
|
||||||
console.log(`[Token Refresh] Refreshed token for ${providerKey}`);
|
// console.log(`[Token Refresh] Refreshed token for ${providerKey}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[Token Refresh Error] Failed to refresh token for ${providerKey}: ${error.message}`);
|
console.error(`[Token Refresh Error] Failed to refresh token for ${providerKey}: ${error.message}`);
|
||||||
// 如果是号池中的某个实例刷新失败,这里需要捕获并更新其状态
|
// 如果是号池中的某个实例刷新失败,这里需要捕获并更新其状态
|
||||||
|
|
|
||||||
|
|
@ -617,6 +617,7 @@ export class QwenApiService {
|
||||||
}
|
}
|
||||||
const currentTime = Date.now();
|
const currentTime = Date.now();
|
||||||
const cronNearMinutesInMillis = (this.config.CRON_NEAR_MINUTES || 10) * 60 * 1000;
|
const cronNearMinutesInMillis = (this.config.CRON_NEAR_MINUTES || 10) * 60 * 1000;
|
||||||
|
console.log(`[Qwen] Expiry date: ${credentials.expiry_date}, Current time: ${currentTime}, ${this.config.CRON_NEAR_MINUTES || 10} minutes from now: ${currentTime + cronNearMinutesInMillis}`);
|
||||||
return credentials.expiry_date <= (currentTime + cronNearMinutesInMillis);
|
return credentials.expiry_date <= (currentTime + cronNearMinutesInMillis);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[Qwen] Error checking expiry date: ${error.message}`);
|
console.error(`[Qwen] Error checking expiry date: ${error.message}`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue