fix: reduce image provider timeout 120s→45s for faster fallback
При недоступности primary (aiguoguo) — быстрее переключаемся на Nyxos fallback вместо ожидания 2 минуты.
This commit is contained in:
@@ -279,7 +279,7 @@ async function generateCoverViaImageGenerations({ prompt }) {
|
|||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
`${baseUrl}/images/generations`,
|
`${baseUrl}/images/generations`,
|
||||||
{ model, prompt: prompt.slice(0, 4000), n: 1, size: '1024x1024', response_format: 'url' },
|
{ model, prompt: prompt.slice(0, 4000), n: 1, size: '1024x1024', response_format: 'url' },
|
||||||
{ headers: { Authorization: `Bearer ${apiKey}` }, timeout: 120_000 }
|
{ headers: { Authorization: `Bearer ${apiKey}` }, timeout: 45_000 }
|
||||||
);
|
);
|
||||||
const item = res.data?.data?.[0];
|
const item = res.data?.data?.[0];
|
||||||
if (!item) throw new Error('No image data in response');
|
if (!item) throw new Error('No image data in response');
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ Strictly: no text, no letters, no logos, no faces of real people.`;
|
|||||||
const res = await axios.post(
|
const res = await axios.post(
|
||||||
`${baseUrl}/images/generations`,
|
`${baseUrl}/images/generations`,
|
||||||
{ model, prompt: prompt.slice(0, 4000), n: 1, size: '1024x1024', response_format: 'url' },
|
{ model, prompt: prompt.slice(0, 4000), n: 1, size: '1024x1024', response_format: 'url' },
|
||||||
{ headers: { Authorization: `Bearer ${apiKey}` }, timeout: 120_000 }
|
{ headers: { Authorization: `Bearer ${apiKey}` }, timeout: 45_000 }
|
||||||
);
|
);
|
||||||
const item = res.data?.data?.[0];
|
const item = res.data?.data?.[0];
|
||||||
if (!item) throw new Error('No image data');
|
if (!item) throw new Error('No image data');
|
||||||
|
|||||||
Reference in New Issue
Block a user