@pedrofariasx/qwenproxy 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/services/qwen.ts +2 -13
package/package.json
CHANGED
package/src/services/qwen.ts
CHANGED
|
@@ -17,7 +17,7 @@ function getClientHintsHeaders(): Record<string, string> {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function getRandomDelay(): number {
|
|
20
|
-
return
|
|
20
|
+
return 30 + Math.floor(Math.random() * 80);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export class RetryableQwenStreamError extends Error {
|
|
@@ -152,18 +152,7 @@ async function refillPoolForAccount(accountId: string) {
|
|
|
152
152
|
let headers: Record<string, string>;
|
|
153
153
|
try {
|
|
154
154
|
const acctId = accountId === 'global' ? undefined : accountId;
|
|
155
|
-
|
|
156
|
-
const { headers: fullHeaders } = await getQwenHeaders(false, acctId);
|
|
157
|
-
headers = {
|
|
158
|
-
cookie: fullHeaders['cookie'] || '',
|
|
159
|
-
'user-agent': fullHeaders['user-agent'] || '',
|
|
160
|
-
'bx-v': fullHeaders['bx-v'] || '',
|
|
161
|
-
'bx-ua': fullHeaders['bx-ua'] || '',
|
|
162
|
-
'bx-umidtoken': fullHeaders['bx-umidtoken'] || '',
|
|
163
|
-
};
|
|
164
|
-
} catch {
|
|
165
|
-
headers = await getBasicQwenHeaders(acctId);
|
|
166
|
-
}
|
|
155
|
+
headers = await getBasicQwenHeaders(acctId);
|
|
167
156
|
} catch (err) {
|
|
168
157
|
console.error(`[WarmPool] header fetch failed for ${accountId}:`, (err as Error).message);
|
|
169
158
|
return;
|