From 9c23f747d9a94a60f3cb64fcf539e97b4da47db4 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Thu, 7 May 2026 21:39:12 -0700 Subject: [PATCH] Stop consulting stately for loadout shares --- api/routes/loadout-share.ts | 44 +------------------- kubernetes/dim-api-stately-backfill-job.yaml | 2 +- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/api/routes/loadout-share.ts b/api/routes/loadout-share.ts index ea8b5c6..2fdfd91 100644 --- a/api/routes/loadout-share.ts +++ b/api/routes/loadout-share.ts @@ -13,10 +13,6 @@ import { } from '../shapes/loadout-share.js'; import { Loadout } from '../shapes/loadouts.js'; import { UserInfo } from '../shapes/user.js'; -import { - deleteLoadoutShare, - getLoadoutShare as getLoadoutShareStately, -} from '../stately/loadout-share-queries.js'; import slugify from './slugify.js'; import { validateLoadout } from './update.js'; @@ -129,43 +125,5 @@ export async function loadLoadoutShare(shareId: string) { recordAccess(client, shareId), ); - if (loadout) { - return loadout; - } - - // Fall back to Stately, and backfill into Postgres if found - const result = await getLoadoutShareStately(shareId); - if (!result) { - return undefined; - } - - // Backfill in Postgres - const backfilled = await transaction(async (client) => { - try { - await addLoadoutShare( - client, - undefined, - result.platformMembershipId, - shareId, - result.loadout, - result.viewCount, - ); - return true; - } catch (e) { - // This is a unique constraint violation, give up - if (e instanceof DatabaseError && e.code === '23505') { - await client.query('ROLLBACK'); - return false; - } else { - throw e; - } - } - }); - - if (backfilled) { - // Remove from Stately only if we successfully backfilled - await deleteLoadoutShare(shareId); - } - - return result.loadout; + return loadout; } diff --git a/kubernetes/dim-api-stately-backfill-job.yaml b/kubernetes/dim-api-stately-backfill-job.yaml index 836d42c..89b6ce9 100644 --- a/kubernetes/dim-api-stately-backfill-job.yaml +++ b/kubernetes/dim-api-stately-backfill-job.yaml @@ -48,7 +48,7 @@ spec: - name: BACKFILL_PARALLEL_SEGMENTS value: '4' - name: BACKFILL_TOKEN_PATH - value: /var/lib/dim-api-backfill/backfill-token.bin + value: /var/lib/dim-api-backfill/backfill-token2.bin - name: BACKFILL_RETRY_MAX_ATTEMPTS value: '12' - name: BACKFILL_RETRY_BASE_DELAY_MS