From f0dd3a7b0ca28912926ac2a1406a310d29fb450b Mon Sep 17 00:00:00 2001 From: Aishwarya Nair Date: Wed, 15 Nov 2023 16:26:45 +0800 Subject: [PATCH] Revert "add attempt history to db" This reverts commit be9067006bf81b80582699a45c9af19f29661939. --- HistoryService/Controllers/HistoryDatabaseController.js | 1 - MatchingService/config/config.js | 4 ++-- MatchingService/controllers/matchingController.js | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/HistoryService/Controllers/HistoryDatabaseController.js b/HistoryService/Controllers/HistoryDatabaseController.js index ebac8b1f9..4760bd478 100644 --- a/HistoryService/Controllers/HistoryDatabaseController.js +++ b/HistoryService/Controllers/HistoryDatabaseController.js @@ -20,7 +20,6 @@ async function connectToDatabase() { port: config.databasePort, user: "root", password: "", - database: "attemptsDatabase" }) .promise(); diff --git a/MatchingService/config/config.js b/MatchingService/config/config.js index 47396a402..3a7710f47 100644 --- a/MatchingService/config/config.js +++ b/MatchingService/config/config.js @@ -5,8 +5,8 @@ module.exports = { mongodbUri: "mongodb://matching-service-database:27017/peer-prep", // mongodbUri: "mongodb://127.0.0.1:27020/peer-prep", // mongodbUri: "mongodb://127.0.0.1:27017/peer-prep", - rabbitmqUrl: "amqp://rabbitmq:5672", - // rabbitmqUrl: "amqp://127.0.0.1:5672", + // rabbitmqUrl: "amqp://rabbitmq:5672", + rabbitmqUrl: "amqp://127.0.0.1:5672", refreshDuration: 3000, // 3 seconds waitingDuration: 3000, matchingDuration: 57000, diff --git a/MatchingService/controllers/matchingController.js b/MatchingService/controllers/matchingController.js index d8f9513ff..7f53921a5 100644 --- a/MatchingService/controllers/matchingController.js +++ b/MatchingService/controllers/matchingController.js @@ -1,6 +1,5 @@ const matchingService = require('../services/matchingService'); const matchingDB = require('../database/matchedPairDb'); -import {addUserAttempt} from '../../Frontend/src/History/HistoryServiceAPI' async function findMatch(req, res, next) { try { @@ -91,14 +90,10 @@ async function endSession(req, res, next) { if (isEnded) { await res.status(200).json({ status: 'success', message: 'Session ended successfully' }); - await addUserAttempt(sessionInfo.id1, + await addUserAttemptToHistoryDatabase(sessionInfo.id1, sessionInfo.id2, sessionInfo.sessionId, sessionInfo.questionId); - // await addUserAttemptToHistoryDatabase(sessionInfo.id1, - // sessionInfo.id2, - // sessionInfo.sessionId, - // sessionInfo.questionId); } else { await res.status(500).json({ status: 'error', message: 'Failed to end session' });