Standardize db rebuildClientAssociationsFromClient

This commit is contained in:
Owen
2026-06-23 15:45:02 -04:00
parent a9b7cce49b
commit c11d24e10a
12 changed files with 51 additions and 63 deletions

View File

@@ -42,7 +42,7 @@ function runQueuedClientAssociationRebuilds(
void (async () => {
for (const client of uniqueClientsById.values()) {
try {
await rebuildClientAssociationsFromClient(client, db);
await rebuildClientAssociationsFromClient(client);
} catch (error) {
logger.error(
`Failed rebuilding associations for client ${client.clientId} (user ${userId}): ${String(error)}`

View File

@@ -1043,9 +1043,9 @@ async function handleSubnetProxyTargetUpdates(
}
export async function rebuildClientAssociationsFromClient(
client: Client,
trx: Transaction | typeof db = db
client: Client
): Promise<void> {
const trx = primaryDb;
try {
return await lockManager.withLock(
`rebuild-client-associations:client:${client.clientId}`,
@@ -2137,7 +2137,7 @@ export function startRebuildQueueProcessor(): void {
return;
}
await rebuildClientAssociationsFromClient(client, primaryDb);
await rebuildClientAssociationsFromClient(client);
}
});
}