mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 15:52:10 +01:00
Broken shit
This commit is contained in:
@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user