From 83796be779fa358dae0b6c9133f66ad3aab3b1fb Mon Sep 17 00:00:00 2001 From: vishalmishraa Date: Thu, 5 Sep 2024 20:01:45 +0530 Subject: [PATCH] fix test comparison --- apps/compiler/src/index.ts | 5 +++++ apps/worker-compiler/src/index.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/compiler/src/index.ts b/apps/compiler/src/index.ts index 65131a9..cd349c7 100644 --- a/apps/compiler/src/index.ts +++ b/apps/compiler/src/index.ts @@ -28,6 +28,11 @@ redis.on('ready', () => { const app = express(); app.use(express.json()); +db.$connect() + .then(() => console.log('Connected to the database')) + .catch((error) => console.error('Database connection error:', error)); + + app.post('/submissions/batch', async (req, res) => { try { diff --git a/apps/worker-compiler/src/index.ts b/apps/worker-compiler/src/index.ts index 3bdf519..d8fbdee 100644 --- a/apps/worker-compiler/src/index.ts +++ b/apps/worker-compiler/src/index.ts @@ -220,10 +220,9 @@ async function runCommand(command: string, code: string, language: string, expec return; } - stdout = stdout.trimEnd(); - if (expected_output !== stdout) { + if (expected_output !== stdout || expected_output + '\n' !== stdout) { console.log(`expected_output: ${expected_output}, stdout: ${stdout}`); resolve({