mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-31 06:59:33 +02:00
Move newt version
This commit is contained in:
parent
825bff5d60
commit
2fea091e1f
1 changed files with 10 additions and 10 deletions
|
@ -64,16 +64,6 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
|||
exitNodeId = bestPingResult.exitNodeId;
|
||||
}
|
||||
|
||||
if (newtVersion) {
|
||||
// update the newt version in the database
|
||||
await db
|
||||
.update(newts)
|
||||
.set({
|
||||
version: newtVersion as string
|
||||
})
|
||||
.where(eq(newts.newtId, newt.newtId));
|
||||
}
|
||||
|
||||
const [oldSite] = await db
|
||||
.select()
|
||||
.from(sites)
|
||||
|
@ -160,6 +150,16 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
|||
allowedIps: [siteSubnet]
|
||||
});
|
||||
|
||||
if (newtVersion && newtVersion !== newt.version) {
|
||||
// update the newt version in the database
|
||||
await db
|
||||
.update(newts)
|
||||
.set({
|
||||
version: newtVersion as string
|
||||
})
|
||||
.where(eq(newts.newtId, newt.newtId));
|
||||
}
|
||||
|
||||
// Improved version
|
||||
const allResources = await db.transaction(async (tx) => {
|
||||
// First get all resources for the site
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue