mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
fix: time out handling
This commit is contained in:
1 parent
c1efc50134
commit
6b9fd1d392
1 file changed
+7
-6
@@ -7,7 +7,6 @@ import { FileChange } from '../core/github/commitMultipleFiles';
|
|||||||
export async function blitzkitTankIcons() {
|
export async function blitzkitTankIcons() {
|
||||||
console.log('Building blitzkit tank icons...');
|
console.log('Building blitzkit tank icons...');
|
||||||
|
|
||||||
console.log('Starting website dev server...');
|
|
||||||
const browser = await launch();
|
const browser = await launch();
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
const tanks = Object.values((await fetchTankDefinitions()).tanks);
|
const tanks = Object.values((await fetchTankDefinitions()).tanks);
|
||||||
@@ -19,12 +18,14 @@ export async function blitzkitTankIcons() {
|
|||||||
width: BLITZKIT_TANK_ICON_SIZE.width - 1,
|
width: BLITZKIT_TANK_ICON_SIZE.width - 1,
|
||||||
height: BLITZKIT_TANK_ICON_SIZE.height,
|
height: BLITZKIT_TANK_ICON_SIZE.height,
|
||||||
});
|
});
|
||||||
await page.goto(`http://localhost:4321/api/tankopedia/tank-icon/${id}/`, {
|
|
||||||
waitUntil: 'networkidle0',
|
|
||||||
});
|
|
||||||
|
|
||||||
if (index === 0) {
|
try {
|
||||||
console.log('Dev server started!');
|
await page.goto(`http://localhost:4321/api/tankopedia/tank-icon/${id}/`, {
|
||||||
|
waitUntil: 'networkidle0',
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`${id} ${name} time out`, error);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const screenshot = await page.screenshot({
|
const screenshot = await page.screenshot({
|
||||||
|
|||||||
Reference in new issue
Block a user