Move fleet retention and concurrency controls into Settings

Persist settings in SQLite, import legacy environment values once, and apply changes to cleanup and deployment queues without restarting.

Closes #51
This commit is contained in:
2026-09-27 16:11:45 -04:00
parent fc46cb9da4
commit 4fe8613678
20 changed files with 334 additions and 54 deletions
+10
View File
@@ -51,6 +51,16 @@ function keysFor(preview: CollectionPreview) {
}
describe('multi-server blueprints', () => {
it('shows the saved startup limit in new previews and existing collection progress', async () => {
const { blueprint, preview } = await previewLineup();
const { queueCollection, getCollection, previewCollection } = await import('../../src/lib/server/fleet/collections.js');
const result = queueCollection({ previewId: preview.id, keys: keysFor(preview) });
const { fleetSettings, saveFleetSettings } = await import('../../src/lib/server/settings.js');
saveFleetSettings({ ...fleetSettings(), createConcurrency: 3 });
expect(previewCollection(blueprint.id).launchConcurrency).toBe(3);
expect(getCollection(result.collectionId!)?.queue.concurrency).toBe(3);
});
it('saves a mixed-game lineup and previews unique slots and global ports without reserving them', async () => {
const { blueprint, preview } = await previewLineup();
const { db } = await import('../../src/lib/server/db/index.js');