mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +00:00
Chungus
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { db } from "@server/db";
|
||||
import { build } from "@server/build";
|
||||
import { db, sessionTransferToken } from "@server/db";
|
||||
import {
|
||||
emailVerificationCodes,
|
||||
newtSessions,
|
||||
@@ -76,4 +77,16 @@ export async function clearStaleData() {
|
||||
} catch (e) {
|
||||
logger.warn("Error clearing expired resourceOtp:", e);
|
||||
}
|
||||
|
||||
if (build !== "oss") {
|
||||
try {
|
||||
await db
|
||||
.delete(sessionTransferToken)
|
||||
.where(
|
||||
lt(sessionTransferToken.expiresAt, new Date().getTime())
|
||||
);
|
||||
} catch (e) {
|
||||
logger.warn("Error clearing expired sessionTransferToken:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ async function executeScripts() {
|
||||
const pendingMigrations = lastExecuted
|
||||
.map((m) => m)
|
||||
.sort((a, b) => semver.compare(b.version, a.version));
|
||||
const startVersion = pendingMigrations[0]?.version ?? "0.0.0";
|
||||
const startVersion = pendingMigrations[0]?.version ?? APP_VERSION;
|
||||
console.log(`Starting migrations from version ${startVersion}`);
|
||||
|
||||
const migrationsToRun = migrations.filter((migration) =>
|
||||
|
||||
Reference in New Issue
Block a user