Skip to content

Commit

Permalink
Recover GPT Service.
Browse files Browse the repository at this point in the history
  • Loading branch information
laihuiqi committed Nov 15, 2023
1 parent b0c418f commit a1184ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions GptService/controllers/gptController.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function getResponse(req, res, next) {

async function exitSession(req, res, next) {
try {
const userId = req.body.userId;
const userId = req.params.userId;

const response = gptService.exitSession(userId);

Expand All @@ -49,7 +49,7 @@ async function exitSession(req, res, next) {

async function getCache(req, res, next) {
try {
const userId = req.body.userId;
const userId = req.params.userId;

const response = gptService.getCache(userId);

Expand Down
4 changes: 2 additions & 2 deletions GptService/routes/gptRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ router.get('/', (req, res) => {

router.post('/generate', controller.getResponse);

router.delete('/exitGpt', controller.exitSession);
router.delete('/exitGpt/:userId', controller.exitSession);

router.get('/getCache', controller.getCache);
router.get('/getCache/:userId', controller.getCache);

module.exports = router;
3 changes: 2 additions & 1 deletion MatchingService/controllers/matchingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function getSession(req, res, next) {
async function endSession(req, res, next) {
try {
const sessionId = req.params.sessionId;
const sessionInfo = await getMatchedPairBySessionId(sessionId);
const sessionInfo = await matchingDB.getMatchedPairBySessionId(sessionId);
const isEnded = await matchingDB.endSession(sessionId);

if (isEnded) {
Expand All @@ -100,6 +100,7 @@ async function endSession(req, res, next) {

}
} catch (error) {
console.log(error);
await res.status(500).json({ status: 'error', message: 'Failed to end session' });
}
}
Expand Down

0 comments on commit a1184ac

Please sign in to comment.