Fix retention query performance and cleanup scheduling

This commit is contained in:
2026-10-06 10:39:32 -04:00
parent 9fd448339d
commit 88a950692a
8 changed files with 104 additions and 8 deletions
+10
View File
@@ -16,6 +16,16 @@ afterEach(async () => {
});
describe('sweep', () => {
it('leaves history cleanup to the retention requester', async () => {
const retention = await import('../../src/lib/server/retention.js');
const prune = vi.spyOn(retention,'pruneHistory');
try {
const { sweep } = await import('../../src/lib/server/pipeline/sweep.js');
await sweep();
expect(prune).not.toHaveBeenCalled();
} finally { prune.mockRestore(); }
});
it('emits server state only when state, players, or error changes', async () => {
const { sweep } = await import('../../src/lib/server/pipeline/sweep.js');
const { seedServerRegistry } = await import('../../src/lib/server/fleet/servers.js');