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({