mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-01 07:39:09 +00:00
Pick client endpoint as part of the transation
This commit is contained in:
@@ -166,7 +166,7 @@ export async function calculateUserClientsForOrgs(
|
||||
];
|
||||
|
||||
// Get next available subnet
|
||||
const newSubnet = await getNextAvailableClientSubnet(orgId);
|
||||
const newSubnet = await getNextAvailableClientSubnet(orgId, transaction);
|
||||
if (!newSubnet) {
|
||||
logger.warn(
|
||||
`Skipping org ${orgId} for OLM ${olm.olmId} (user ${userId}): no available subnet found`
|
||||
|
||||
@@ -244,7 +244,8 @@ export function isIpInCidr(ip: string, cidr: string): boolean {
|
||||
}
|
||||
|
||||
export async function getNextAvailableClientSubnet(
|
||||
orgId: string
|
||||
orgId: string,
|
||||
transaction: Transaction | typeof db = db
|
||||
): Promise<string> {
|
||||
const [org] = await db.select().from(orgs).where(eq(orgs.orgId, orgId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user