Skip to content

Commit 1e76297

Browse files
author
Aishwarya Nair
committed
Merge branch 'test-updated-merge' of https://github.com/CS3219-AY2324S1/ay2324s1-course-assessment-g16 into test-updated-merge
2 parents d220843 + d6d91ff commit 1e76297

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

MatchingService/config/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module.exports = {
55
mongodbUri: "mongodb://matching-service-database:27017/peer-prep",
66
// mongodbUri: "mongodb://127.0.0.1:27020/peer-prep",
77
// mongodbUri: "mongodb://127.0.0.1:27017/peer-prep",
8-
rabbitmqUrl: "amqp://rabbitmq:5672",
9-
// rabbitmqUrl: "amqp://127.0.0.1:5672",
8+
// rabbitmqUrl: "amqp://rabbitmq:5672",
9+
rabbitmqUrl: "amqp://127.0.0.1:5672",
1010
refreshDuration: 3000, // 3 seconds
1111
waitingDuration: 3000,
1212
matchingDuration: 57000,

MatchingService/controllers/matchingController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function getActiveSession(req, res, next) {
5555

5656
}
5757
} catch (error) {
58-
next(error);
58+
await res.status(500).json({ sessionId: null })
5959
}
6060
}
6161

@@ -78,7 +78,7 @@ async function getSession(req, res, next) {
7878

7979
}
8080
} catch (error) {
81-
next(error);
81+
await res.status(500).json({ sessionId: null, session: null});
8282
}
8383
}
8484

@@ -100,7 +100,7 @@ async function endSession(req, res, next) {
100100

101101
}
102102
} catch (error) {
103-
next(error);
103+
await res.status(500).json({ status: 'error', message: 'Failed to end session' });
104104
}
105105
}
106106

@@ -116,7 +116,7 @@ async function cancelMatch(req, res, next) {
116116

117117
}
118118
} catch (error) {
119-
next(error);
119+
await res.status(500).json({ message: 'Failed to cancel match' });
120120
}
121121
}
122122

0 commit comments

Comments
 (0)