mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 09:16:40 +00:00
Pass in db to pickPort
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { db } from "@server/db";
|
||||
import { db, Transaction } from "@server/db";
|
||||
import { resources, targets } from "@server/db";
|
||||
import { eq } from "drizzle-orm";
|
||||
|
||||
const currentBannedPorts: number[] = [];
|
||||
|
||||
export async function pickPort(siteId: number): Promise<{
|
||||
export async function pickPort(siteId: number, trx: Transaction | typeof db): Promise<{
|
||||
internalPort: number;
|
||||
targetIps: string[];
|
||||
}> {
|
||||
@@ -12,7 +12,7 @@ export async function pickPort(siteId: number): Promise<{
|
||||
const targetIps: string[] = [];
|
||||
const targetInternalPorts: number[] = [];
|
||||
|
||||
const targetsRes = await db
|
||||
const targetsRes = await trx
|
||||
.select()
|
||||
.from(targets)
|
||||
.where(eq(targets.siteId, siteId));
|
||||
|
||||
Reference in New Issue
Block a user