Add cancellation and cleanup for native server creation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { heartbeat } from '$lib/server/hosts/index.js';
|
||||
import { heartbeat, pendingCreationCancellations } from '$lib/server/hosts/index.js';
|
||||
import { authenticateAgent, hostApiError, objectBody } from '$lib/server/hosts/http.js';
|
||||
import { reconcileHostPreparation } from '$lib/server/hosts/preparation.js';
|
||||
export async function POST({ request }: { request: Request }) {
|
||||
@@ -13,6 +13,6 @@ export async function POST({ request }: { request: Request }) {
|
||||
updateHostLibraryCaches(host.id, inventory.libraryCaches, { snapshot: true });
|
||||
}
|
||||
reconcileHostPreparation(host.id);
|
||||
return json({ host, heartbeatSeconds: 15, serverTime: new Date().toISOString() });
|
||||
return json({ host, cancelledCreations: pendingCreationCancellations(host.id), heartbeatSeconds: 15, serverTime: new Date().toISOString() });
|
||||
} catch (cause) { return hostApiError(cause); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user