Conform blueprint launches to desired fleet counts

This commit is contained in:
2026-09-18 00:28:17 -04:00
parent 989931a0f2
commit 586133c711
11 changed files with 183 additions and 44 deletions
@@ -9,7 +9,7 @@ export async function POST({ request }: { request: Request }) {
const body = await request.json();
if (!body || typeof body !== 'object' || Array.isArray(body)) throw new Error('Provide a collection preview and its server keys.');
const result = queueCollection(body);
void kick().catch(err => console.error('[collection] worker kick failed:', err));
return json(result, { status: 202 });
if (result.collectionId) void kick().catch(err => console.error('[collection] worker kick failed:', err));
return json(result, { status: result.collectionId ? 202 : 200 });
} catch (err) { return json({ error: (err as Error).message }, { status: 400 }); }
}