Broken shit

This commit is contained in:
Max Kowalski
2025-06-26 21:00:19 +02:00
parent ab2c75b736
commit 653d70022b
49 changed files with 2826 additions and 2102 deletions

View File

@ -10,16 +10,18 @@ import { dirname, join } from "path";
// Load environment variables from .env.local
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const envPath = join(__dirname, '..', '.env.local');
const envPath = join(__dirname, "..", ".env.local");
try {
const envFile = readFileSync(envPath, 'utf8');
const envVars = envFile.split('\n').filter(line => line.trim() && !line.startsWith('#'));
const envFile = readFileSync(envPath, "utf8");
const envVars = envFile
.split("\n")
.filter((line) => line.trim() && !line.startsWith("#"));
envVars.forEach(line => {
const [key, ...valueParts] = line.split('=');
envVars.forEach((line) => {
const [key, ...valueParts] = line.split("=");
if (key && valueParts.length > 0) {
const value = valueParts.join('=').trim();
const value = valueParts.join("=").trim();
if (!process.env[key.trim()]) {
process.env[key.trim()] = value;
}
@ -65,11 +67,8 @@ async function triggerProcessingScheduler() {
AND: [
{ messages: { some: {} } },
{
OR: [
{ processed: false },
{ processed: null }
]
}
OR: [{ processed: false }, { processed: null }],
},
],
},
select: {
@ -129,10 +128,7 @@ async function showProcessingStatus() {
});
const unprocessedSessions = await prisma.session.count({
where: {
OR: [
{ processed: false },
{ processed: null }
]
OR: [{ processed: false }, { processed: null }],
},
});
const withMessages = await prisma.session.count({
@ -147,11 +143,8 @@ async function showProcessingStatus() {
AND: [
{ messages: { some: {} } },
{
OR: [
{ processed: false },
{ processed: null }
]
}
OR: [{ processed: false }, { processed: null }],
},
],
},
});
@ -170,11 +163,8 @@ async function showProcessingStatus() {
AND: [
{ messages: { some: {} } },
{
OR: [
{ processed: false },
{ processed: null }
]
}
OR: [{ processed: false }, { processed: null }],
},
],
},
select: {