Pass through transaction

This commit is contained in:
Owen
2025-10-17 14:04:49 -07:00
parent e5a436593f
commit c07abf8ff9
4 changed files with 29 additions and 19 deletions

View File

@@ -18,7 +18,8 @@ import {
resources,
targets,
sites,
targetHealthCheck
targetHealthCheck,
Transaction
} from "@server/db";
import logger from "@server/logger";
import { ExitNodePingResult } from "@server/routers/newt";
@@ -333,8 +334,8 @@ export function selectBestExitNode(
return fallbackNode;
}
export async function checkExitNodeOrg(exitNodeId: number, orgId: string) {
const [exitNodeOrg] = await db
export async function checkExitNodeOrg(exitNodeId: number, orgId: string, trx: Transaction | typeof db = db) {
const [exitNodeOrg] = await trx
.select()
.from(exitNodeOrgs)
.where(