Skip to content

Commit

Permalink
Revert "add attempt history to db"
Browse files Browse the repository at this point in the history
This reverts commit be90670.
  • Loading branch information
Aishwarya Nair committed Nov 15, 2023
1 parent 74db451 commit f0dd3a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion HistoryService/Controllers/HistoryDatabaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ async function connectToDatabase() {
port: config.databasePort,
user: "root",
password: "",
database: "attemptsDatabase"
})
.promise();

Expand Down
4 changes: 2 additions & 2 deletions MatchingService/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 1 addition & 6 deletions MatchingService/controllers/matchingController.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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' });
Expand Down

0 comments on commit f0dd3a7

Please sign in to comment.