mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-25 07:24:29 +00:00
Build client site resource associations and send messages
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
olms,
|
||||
Site,
|
||||
sites,
|
||||
clientSites,
|
||||
clientSitesAssociationsCache,
|
||||
exitNodes,
|
||||
ExitNode
|
||||
} from "@server/db";
|
||||
@@ -174,11 +174,11 @@ export async function updateAndGenerateEndpointDestinations(
|
||||
listenPort: sites.listenPort
|
||||
})
|
||||
.from(sites)
|
||||
.innerJoin(clientSites, eq(sites.siteId, clientSites.siteId))
|
||||
.innerJoin(clientSitesAssociationsCache, eq(sites.siteId, clientSitesAssociationsCache.siteId))
|
||||
.where(
|
||||
and(
|
||||
eq(sites.exitNodeId, exitNode.exitNodeId),
|
||||
eq(clientSites.clientId, olm.clientId)
|
||||
eq(clientSitesAssociationsCache.clientId, olm.clientId)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -189,14 +189,14 @@ export async function updateAndGenerateEndpointDestinations(
|
||||
);
|
||||
|
||||
await db
|
||||
.update(clientSites)
|
||||
.update(clientSitesAssociationsCache)
|
||||
.set({
|
||||
endpoint: `${ip}:${port}`
|
||||
})
|
||||
.where(
|
||||
and(
|
||||
eq(clientSites.clientId, olm.clientId),
|
||||
eq(clientSites.siteId, site.siteId)
|
||||
eq(clientSitesAssociationsCache.clientId, olm.clientId),
|
||||
eq(clientSitesAssociationsCache.siteId, site.siteId)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user